Skip to content

Commit

Permalink
fix poetry shell for zsh if space character in venv path (#7245)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimstunt authored Jan 20, 2024
1 parent a67c0ec commit 47fe2ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/poetry/utils/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ def activate(self, env: VirtualEnv) -> int | None:

if self._name == "zsh":
# Under ZSH the source command should be invoked in zsh's bash emulator
c.sendline(f"emulate bash -c '. {shlex.quote(str(activate_path))}'")
quoted_activate_path = shlex.quote(str(activate_path))
c.sendline(f"emulate bash -c {shlex.quote(f'. {quoted_activate_path}')}")
elif self._name == "xonsh":
c.sendline(f"vox activate {shlex.quote(str(env.path))}")
elif self._name in ["nu", "fish"]:
Expand Down

0 comments on commit 47fe2ac

Please sign in to comment.