Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config: Disable environment prompt when using shell #1853

Closed
2 tasks done
MooseV2 opened this issue Jan 9, 2020 · 7 comments · Fixed by #7874
Closed
2 tasks done

Config: Disable environment prompt when using shell #1853

MooseV2 opened this issue Jan 9, 2020 · 7 comments · Fixed by #7874
Labels
area/docs Documentation issues/improvements good first issue

Comments

@MooseV2
Copy link

MooseV2 commented Jan 9, 2020

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

Recently, a feature was added that allows poetry shell to modify the prompt (PS1 in some shells) to show the current environment. See #1642.

However, this conflicts with prompts that already show the environment, causing text duplication.
poetry

A configuration option to prevent the prompt from being modified would resolve this.

My configuration

OS: macOS Catalina 10.15.1
Shell: Fish 3.0.2
Poetry: 1.0.0

@MooseV2 MooseV2 added the kind/feature Feature requests/implementations label Jan 9, 2020
@MooseV2
Copy link
Author

MooseV2 commented Jan 9, 2020

Ah, upon further research, I have discovered the environment variable, VIRTUAL_ENV_DISABLE_PROMPT.

Because Poetry uses Virtualenv internally, exporting this with export VIRTUAL_ENV_DISABLE_PROMPT=1 (or in Fish, set -x VIRTUAL_ENV_DISABLE_PROMPT 1) appears to resolve this issue.

Perhaps this is a documentation issue instead? People who are using Poetry as a turnkey solution shouldn't have to dig into the internal workings (ie virtualenv).

Otherwise, a config variable could set VIRTUAL_ENV_DISABLE_PROMPT before spawning the virtualenv when poetry shell is issued.

@grisaitis
Copy link

I second this.

I would also like a config variable to prevent the PS1 modification. Or at least document it.

In my situation, I use bash-it to have a cute shell prompt. poetry shell totally vanquishes this.

Where would this setting be (@MooseV2)? in the [tools.poetry] section of pyproject.toml? [tools.poetry.env]?

@hyunlee1o
Copy link

hyunlee1o commented Nov 19, 2020

I have this problem, i use powerline_shell and i am getting two times the virtualenv name.
Please fix this. :)
I have added set -x VIRTUAL_ENV_DISABLE_PROMPT 1 to my ~/.config/fish/config.fish and it works.

@neersighted neersighted added area/docs Documentation issues/improvements good first issue and removed kind/feature Feature requests/implementations labels Oct 5, 2022
@neersighted
Copy link
Member

Poetry just uses upstream virtualenv -- as such, this is a docs issue.

@matiaslagoevia
Copy link

Hello, I'd like to tackle this issue if possible. If so, could I have some guidance of the updates needed for the docs? I'd be happy to groom the issue further with assistance, thanks!

@tamakiii
Copy link

Setting virtualenv.prompt config worked for me.

python3 -m poetry config --list
python3 -m poetry config --local --list
python3 -m poetry config virtualenvs.prompt
python3 -m poetry config --local virtualenvs.promptpython3 -m poetry config --local virtualenvs.prompt null

https://gist.github.com/tamakiii/6946265e53872882d2114b1a50bb828a

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/docs Documentation issues/improvements good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants