Commit 770a8148 by Brian Marroquin Committed by Bjorn Neergaard

adds fallback behavior for non-ms shells

parent 04184247
...@@ -78,12 +78,22 @@ class Shell: ...@@ -78,12 +78,22 @@ class Shell:
if sys.platform == "win32": if sys.platform == "win32":
if self._name in ("powershell", "pwsh"): if self._name in ("powershell", "pwsh"):
args = ["-NoExit", "-File", str(activate_path)] args = ["-NoExit", "-File", str(activate_path)]
else: elif self._name == "cmd":
# /K will execute the bat file and # /K will execute the bat file and
# keep the cmd process from terminating # keep the cmd process from terminating
args = ["/K", str(activate_path)] args = ["/K", str(activate_path)]
completed_proc = subprocess.run([self.path, *args]) else:
return completed_proc.returncode args = None
if args:
completed_proc = subprocess.run([self.path, *args])
return completed_proc.returncode
else:
# If no args are set, execute the shell within the venv
# This activates it, but there could be some features missing:
# deactivate command might not work
# shell prompt will not be modified.
return env.execute(self._path)
import shlex import shlex
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment