Commit bc3ad7db by pwoolvett Committed by GitHub

fix(shell): quote path before activating env

Resolves: #3630
parent ae60ac58
...@@ -65,6 +65,8 @@ class Shell: ...@@ -65,6 +65,8 @@ class Shell:
if WINDOWS: if WINDOWS:
return env.execute(self.path) return env.execute(self.path)
import shlex
terminal = Terminal() terminal = Terminal()
with env.temp_environ(): with env.temp_environ():
c = pexpect.spawn( c = pexpect.spawn(
...@@ -77,7 +79,9 @@ class Shell: ...@@ -77,7 +79,9 @@ class Shell:
activate_script = self._get_activate_script() activate_script = self._get_activate_script()
bin_dir = "Scripts" if WINDOWS else "bin" bin_dir = "Scripts" if WINDOWS else "bin"
activate_path = env.path / bin_dir / activate_script activate_path = env.path / bin_dir / activate_script
c.sendline("{} {}".format(self._get_source_command(), activate_path)) c.sendline(
"{} {}".format(self._get_source_command(), shlex.quote(str(activate_path)))
)
def resize(sig: Any, data: Any) -> None: def resize(sig: Any, data: Any) -> None:
terminal = Terminal() terminal = Terminal()
......
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