Poetry: Poetry shell seems to spawn a non-login shell, giving a very minimalistic prompt

Created on 20 Jan 2020  路  2Comments  路  Source: python-poetry/poetry

  • [x] I am on the latest Poetry version.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.

  • OS version and name: macOS 10.14.6

  • Poetry version: 1.0.2

Issue

poetry shell seems to override the prompt completely in a very aggressive way. My prompt currently looks like this

username@host:mydir (gitrepo) [15 stash] $

When I invoke poetry shell the resulting prompt looks like

Spawning shell within .../virtualenvs/omitted
bash-3.2$ . /omitted/bin/activate
(rip-oEcYTxbK-py3.7) bash-3.2$ cd -

I suspect this is because the shell is not spawned as a login shell, hence it does not parse configuration files (e.g. bashrc). This might be a bug or a missing feature. If the second, poetry shell should have an option to spawn a login shell.

Bug

Most helpful comment

I think this is worse than this.

Running poetry shell for bash clears anything defined in .bash_profile, which is where the standard "run once" interactive shell definitions go. Anything setup like development variables, custom prompts all get wiped away.

It will read .bashrc though.

This seems to suggest that current environment variables set in the current shell, might also get blown away.

Note this behavior is different than running activate inside the virtualenv because activate doesn't blow away your shell environment.

Note that pipenv shell doesn't blow away the definitions set by .bash_profile.

All 2 comments

I think this is worse than this.

Running poetry shell for bash clears anything defined in .bash_profile, which is where the standard "run once" interactive shell definitions go. Anything setup like development variables, custom prompts all get wiped away.

It will read .bashrc though.

This seems to suggest that current environment variables set in the current shell, might also get blown away.

Note this behavior is different than running activate inside the virtualenv because activate doesn't blow away your shell environment.

Note that pipenv shell doesn't blow away the definitions set by .bash_profile.

Same for me:

  • OS version and name: macOS 10.15.5
  • Poetry version 1.0.9
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jackemuk picture jackemuk  路  3Comments

sobolevn picture sobolevn  路  3Comments

probablykasper picture probablykasper  路  3Comments

etijskens picture etijskens  路  3Comments

thejohnfreeman picture thejohnfreeman  路  3Comments