Skip to content

Commit

Permalink
Remove fish --init-command
Browse files Browse the repository at this point in the history
Don't use --init-command when starting a fish venv subshell, instead treat it as other shells. The --init--command doesn't work well with python managed by mise.

Ref: python-poetry/poetry#9463
  • Loading branch information
phette23 authored Jun 1, 2024
1 parent 108d732 commit 74f61a7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/poetry/utils/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ def activate(self, env: VirtualEnv) -> int | None:
with env.temp_environ():
if self._name == "nu":
args = ["-e", cmd]
elif self._name == "fish":
args = ["-i", "--init-command", cmd]
else:
args = ["-i"]

Expand All @@ -126,8 +124,8 @@ def activate(self, env: VirtualEnv) -> int | None:
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"]:
# If this is nu or fish, we don't want to send the activation command to the
elif self._name in ["nu"]:
# If this is nu, we don't want to send the activation command to the
# command line since we already ran it via the shell's invocation.
pass
else:
Expand Down

0 comments on commit 74f61a7

Please sign in to comment.