Skip to content

poetry shell does not send a newline to fish #7883

@NiklasKappel

Description

@NiklasKappel
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Steps to reproduce:

fish
cd poetry/
poetry shell

Observed behavior ("|" represents cursor position):

[niklas@toolbox poetry]$ poetry shell
Spawning shell within /var/home/niklas/.cache/pypoetry/virtualenvs/poetry-Xjwftcq8-py3.11
[niklas@toolbox poetry]$ source /var/home/niklas/.cache/pypoetry/virtualenvs/poetry-Xjwftcq8-py3.11/bin/activate.fish|

Expected behavior:

[niklas@toolbox poetry]$ poetry shell
Spawning shell within /var/home/niklas/.cache/pypoetry/virtualenvs/poetry-Xjwftcq8-py3.11
[niklas@toolbox poetry]$ source /var/home/niklas/.cache/pypoetry/virtualenvs/poetry-Xjwftcq8-py3.11/bin/activate.fish
(poetry-py3.11) [niklas@toolbox poetry]$ |

In fish, the source command is not executed automatically when running poetry shell. The reason is that fish does not count os.linesep as a return/enter when the sendline method of pexpect is used. Compare here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions