-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Typing messes up terminal/venv activation #24589
Comments
We can’t avoid running activation scripts in cases where VS Code is not launched from an activated environment. The best thing to do here is turn off activation and launch VS Code from an activated environment. Here is how:
This will star VS Code itself in an activated environment and there is no need for us to activate it later. |
I don't mind if it's running activation scripts, but is it possible that it won't interfere with the terminal input? |
Unfortunately it has the same behavior with shell integration enabled |
It looks like timeout https://github.com/microsoft/vscode-python/blob/main/src/client/common/terminal/service.ts#L100 is not "long enough" to wait for executeCommand. If @j4k0xb check your Python output after setting your log level to "trace" We may have to do improve to more frequently use executeCommand such as via caching shell integration state from previous session. Or figure out different way to completely wait for activate command before allowing user input in terminal. Using pwsh 6 or 7 instead of the default windows pwsh provided by Microsoft can really help with executeCommand, shell integration related. @j4k0xb I assume you will notice the duplicate commands wont really happen after the very first run in terminal. Is that correct? |
yes
I only encountered this issue during the first activation in a terminal |
Thanks for the info |
(I don't use Windows or PowerShell) Peek.2024-12-12.19-55.mp4 |
Type: Bug
Behaviour
The
source /tmp/test/venv/bin/activate
command is appended to the current terminal input, which messes it up.This often happens when typing shortly after launching a new terminal.
Steps to reproduce:
python3 -m venv venv
Output:
a% ❯ asource /tmp/test/venv/bin/activate zsh: command not found: asource
Peek.2024-12-12.01-15.mp4
Related issue: #23893
Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Extension version: 2024.22.0
VS Code version: Code 1.96.0 (138f619c86f1199955d53b4166bef66ef252935c, 2024-12-11T02:29:09.626Z)
OS version: Linux x64 6.6.54-2-MANJARO
Modes:
python.languageServer
setting: PylanceUser Settings
Installed Extensions
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
The text was updated successfully, but these errors were encountered: