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

Double virtual env prompt when using pure prompt in Vscode #22983

Closed
ggydush opened this issue Feb 27, 2024 · 5 comments
Closed

Double virtual env prompt when using pure prompt in Vscode #22983

ggydush opened this issue Feb 27, 2024 · 5 comments
Labels
experimenting Feature is part of an experiment triage-needed Needs assignment to the proper sub-team

Comments

@ggydush
Copy link

ggydush commented Feb 27, 2024

Type: Bug

Behaviour

Expected vs. Actual

Expected: virtual environment information should only appear once.
Actual: virtual environment appears twice

I realize that it's difficult to support all custom shells, so let me know if you think this is outside of the scope.

Steps to reproduce:

  1. Initialize pure prompt in zsh
  2. Open a Vscode Python project and open terminal view

Note: the default PS1 of Pure is as follows:

%{%(12V.%F{$prompt_pure_colors[virtualenv]}%12v%f .)%(?.%F{$prompt_pure_colors[prompt:success]}.%F{$prompt_pure_colors[prompt:error]})${prompt_pure_state[prompt]}%f %}

It looks like Vscode modifies PS1 with

PS1=(pipeline-ErT9kUro-py3.11) ${env:PS1}

This causes the virtual environment to appear twice:

(pipeline-ErT9kUro-py3.11) pipeline-ErT9kUro-py3.11 > 

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.5
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Poetry
  • Value of the python.languageServer setting: Pylance
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

User Settings


languageServer: "Pylance"

testing
• pytestArgs: "<placeholder>"
• pytestEnabled: true

Extension version: 2024.1.10571728
VS Code version: Code 1.86.2 (903b1e9d8990623e3d7da1df3d33db3e42d80eda, 2024-02-13T19:42:13.651Z)
OS version: Darwin x64 23.3.0
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2300)
GPU Status 2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: disabled_software
video_encode: disabled_software
webgl: unavailable_software
webgl2: unavailable_software
webgpu: unavailable_software
Load (avg) 5, 3, 3
Memory (System) 32.00GB (5.63GB free)
Process Argv --crash-reporter-id d672dfd6-f5be-42c7-8063-4786ead4bb34
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:30968133
pythontbext0:30879054
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
pydisww2:30959801
cppperfnew:30973185
d34g3935:30971562
edj9j583:30969295

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 27, 2024
@karrtikr karrtikr added the experimenting Feature is part of an experiment label Feb 27, 2024
@karrtikr
Copy link

Please provide the debug logs which can help diagnose the issue:

  • Run Developer: Set log level command
  • Select Trace
  • Run Developer: Reload Window command
  • Provide the output:
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Feb 27, 2024
@ggydush
Copy link
Author

ggydush commented Feb 27, 2024

Output

Is there a particular section that is useful? This dumps some sensitive information (e.g., ENV variables with keys) - I can redact that, it just appears multiple times

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Feb 27, 2024
@ggydush
Copy link
Author

ggydush commented Feb 27, 2024

Here's the trace log.txt

@karrtikr
Copy link

Note: the default PS1 of Pure is as follows:

I expect "pure" prompt is set up in one of the initialization scripts for zsh (.zshrc etc.) which we currently don't have access to. This should be fixed by #22128.

For now, you can simply set VIRTUAL_ENV_DISABLE_PROMPT to 1 as a systems variable, which Python extension makes sure to pick up. That should disable the prompt in your case.

@ggydush
Copy link
Author

ggydush commented Feb 27, 2024

Great, thank you! Will follow #22128!

@karrtikr karrtikr closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
experimenting Feature is part of an experiment triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants