Skip to content

Commit

Permalink
send \r to fish when using poetry shell to execute source command (py…
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasKappel authored May 7, 2023
1 parent c27142f commit ff77e26
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/poetry/utils/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ def activate(self, env: VirtualEnv) -> int | None:
# Under ZSH the source command should be invoked in zsh's bash emulator
c.sendline(f"emulate bash -c '. {shlex.quote(str(activate_path))}'")
else:
c.sendline(
f"{self._get_source_command()} {shlex.quote(str(activate_path))}"
)
cmd = f"{self._get_source_command()} {shlex.quote(str(activate_path))}"
if self._name == "fish":
# Under fish "\r" should be sent explicitly
cmd += "\r"
c.sendline(cmd)

def resize(sig: Any, data: Any) -> None:
terminal = shutil.get_terminal_size()
Expand Down

0 comments on commit ff77e26

Please sign in to comment.