Skip to content

Cannot read properties of undefined (reading 'show') #958

Description

Type: Bug

Behaviour

When I select python code and hit shift + Enter for the first time, a python terminal starts, the python code is not run in ther terminal and a window opens with the message "Cannot read properties of undefined (reading 'show')"

I use zsh terminal, poetry as env manager and ipython as python terminal.

I have the following parameters:

"python.experiments.optOutFrom": ["pythonTerminalEnvVarActivation"],
"python.useEnvironmentsExtension": true,
// "python-envs.terminal.autoActivationType": "shellStartup",
"python-envs.defaultEnvManager": "ms-python.python:poetry",
"python-envs.defaultPackageManager": "ms-python.python:poetry",

When I uncomment "python-envs.terminal.autoActivationType": "shellStartup", the code is usually run in the zsh terminal and the python terminal is not active

Steps to reproduce:

Capture.video.du.2025-10-31.15-42-21.webm

Diagnostic data

Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

XXX

Extension version: 1.10.0
VS Code version: Code 1.105.1 (7d842fb85a0275a4a8e4d7e040d2625abbf7f084, 2025-10-14T22:33:36.618Z)
OS version: Linux x64 6.14.0-34-generic
Modes:

System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i7-13620H (16 x 400)
GPU Status 2d_canvas: enabled
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
trees_in_viz: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
Load (avg) 1, 1, 1
Memory (System) 31.04GB (17.40GB free)
Process Argv --crash-reporter-id a87c9fe0-82ab-4ddf-93a4-a8ee0d063686
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
A/B Experiments
vsliv368:30146709
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
aj953862:31281341
nes-set-on:31351930
6abeh943:31336334
envsdeactivate2:31353495
aa_c:31379599
gendocstringf:31405073
0574c672:31404437
cloudbuttont:31379625
todos-1:31405332
v66_all_req:31402695
treatment_gpt5applypatchexclusively:31398171
3efgi100_wstrepl:31403338
trigger-command-fix:31379601
auto_model_enabled:31385282
use-responses-api:31390855
applesignin:31399435
2a0ce269:31405347
ff8f5884:31411053

Activity

  1. Quentin62 commented on Nov 14, 2025

    @Quentin62
    Author

    I don't have the message "Cannot read properties of undefined (reading 'show')" since the last update.

    Now I have the following message and the python terminal is not launched:

    Image

    When I select a python interpreter and retry, I have always the same message and issue.
    When I set "python.useEnvironmentsExtension": false, the python terminal is running but the selected code is run in the zsh terminal before the activation of the python terminal

  2. anthonykim1 commented on Dec 11, 2025

    @anthonykim1
    Contributor

    Im glad you dont see "Cannot read properties of undefined (reading 'show')"

    To get the python environment to activate before your command, you need shell startup from environment extension

    Try with latest insiders and latest pre-release of Python env extension.

  3. added
    bugIssue identified by VS Code Team member as probable bug
    area-terminalEnvironment extension specific terminal issues.
    area-activationIssue related to activation. Root cause can be from interpreter selection or activation in terminal
    and removed
    confirmation-pendingThe issue needs to be confirmed through a maintainer reproducing the bug.
    on Dec 11, 2025
  4. Quentin62 commented on Dec 12, 2025

    @Quentin62
    Author

    I got a new laptop at work and had to make a new configuration for ubuntu on WSL and the problem is still there:
    When I use the python environment and run selected code, awindow "Cannot read properties of undefined (reading 'show')" appears and the code is not run in the activated environment

    I'm using python environment v1.14.0

    parameters

        "python.useEnvironmentsExtension": true,
        "python-envs.terminal.autoActivationType": "shellStartup",
        "python-envs.defaultEnvManager": "ms-python.python:poetry",
    

    vscode added this to my .zshrc file

    # >>> vscode python
    # version: 0.1.1
    if [ -z "$VSCODE_PYTHON_AUTOACTIVATE_GUARD" ]; then
        export VSCODE_PYTHON_AUTOACTIVATE_GUARD=1
        if [ -n "$VSCODE_PYTHON_ZSH_ACTIVATE" ] && [ "$TERM_PROGRAM" = "vscode" ]; then
            eval "$VSCODE_PYTHON_ZSH_ACTIVATE" || true
        fi
    fi
    # <<< vscode python
    
  5. karthiknadig commented on Dec 12, 2025

    @karthiknadig
    Member

    Can you share the call stack of the error? It should be there in the logs output > Python Extension or in Help > Toggle developer tools.

  6. Quentin62 commented on Dec 12, 2025

    @Quentin62
    Author

    I set the log at debug level and got

    log of python extension

    2025-12-12 14:49:17.974 [info] > /bin/python3 ~/.vscode-server/extensions/ms-python.python-2025.20.0-linux-x64/python_files/normalizeSelection.py
    

    log of python env

    2025-12-12 14:49:18.474 [debug] Activating terminal: /home/quentin/Projet/my_project/.venv/bin/python
    2025-12-12 14:49:19.532 [debug] Shell execution started: source /home/quentin/Projet/my_project/.venv/bin/activate
    2025-12-12 14:49:19.532 [debug] Checking venv (ms-python.python:venv) for /home/quentin/Projet/my_project/.venv/bin/python
    2025-12-12 14:49:19.532 [debug] Using venv (ms-python.python:venv) to handle /home/quentin/Projet/my_project/.venv/bin/python
    2025-12-12 14:49:19.555 [info] Terminal is activated: /home/quentin/Projet/my_project/.venv/bin/python
    2025-12-12 14:49:19.555 [debug] Checking venv (ms-python.python:venv) for /home/quentin/Projet/my_project/.venv/bin/python
    2025-12-12 14:49:19.556 [debug] Using venv (ms-python.python:venv) to handle /home/quentin/Projet/my_project/.venv/bin/python
    2025-12-12 14:49:23.078 [debug] Checking venv (ms-python.python:venv) for /home/quentin/Projet/my_project/.venv/bin/python
    2025-12-12 14:49:23.078 [debug] Using venv (ms-python.python:venv) to handle /home/quentin/Projet/my_project/.venv/bin/python
    2025-12-12 14:49:23.198 [debug] Checking venv (ms-python.python:venv) for /home/quentin/Projet/my_project/.venv/bin/python
    2025-12-12 14:49:23.198 [debug] Using venv (ms-python.python:venv) to handle /home/quentin/Projet/my_project/.venv/bin/python
    

    log of "Extension Host (remote)"

    2025-12-12 14:49:19.532 [error] TypeError: Cannot read properties of undefined (reading 'show')
    	at b.executeCommand (/home/quentin/.vscode-server/extensions/ms-python.python-2025.20.0-linux-x64/out/client/extension.js:2:316843)
    	at y.executeCommand (/home/quentin/.vscode-server/extensions/ms-python.python-2025.20.0-linux-x64/out/client/extension.js:2:331216)
    	at E.execute (/home/quentin/.vscode-server/extensions/ms-python.python-2025.20.0-linux-x64/out/client/extension.js:2:892308)
    	at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    	at async P.executeSelection (/home/quentin/.vscode-server/extensions/ms-python.python-2025.20.0-linux-x64/out/client/extension.js:2:877143)
    	at async P.executeSelectionInTerminal (/home/quentin/.vscode-server/extensions/ms-python.python-2025.20.0-linux-x64/out/client/extension.js:2:876605)
    	at async /home/quentin/.vscode-server/extensions/ms-python.python-2025.20.0-linux-x64/out/client/extension.js:2:874599
    	at async cA.h (file:///home/quentin/.vscode-server/bin/618725e67565b290ba4da6fe2d29f8fa1d4e3622/out/vs/workbench/api/node/extensionHostProcess.js:116:41740) python.execSelectionInTerminal {"value":"ms-python.python","_lower":"ms-python.python"}
    
  7. 8 remaining items

  8. added this to the milestone on Dec 15, 2025
  9. Quentin62 commented on Dec 15, 2025

    @Quentin62
    Author

    I open an existing project, with a virtual env created by poetry in the project folder (I changed the default config of poetry because the created envs in the folder /home/<username>/pypoetry/ were not easily found by vscode).

    poetry config virtualenvs.in-project true
    

    The env is already selected as the python interpreter of the project.

    • without python environment : when I shift+enter code => it fails a lot
    • with python environment -> it has not kept the information of the selected interpreter, the env is not list in the poetry list but in venv. Once I select it as my python interpreter, the shift+enter on code works. At first, the coloration of installed python packages does not work, but once I reopen vscode, the coloration is ok.
    Enregistrement.de.lecran.2025-12-15.114849.1.mp4
  10. Quentin62 commented on Dec 15, 2025

    @Quentin62
    Author

    I change the poetry config

    poetry config virtualenvs.in-project false
    

    The environment is discovered and automatically select has the python interpreter

    Enregistrement.de.lecran.2025-12-15.131239.mp4
  11. anthonykim1 commented on Dec 15, 2025

    @anthonykim1
    Contributor

    was able to finally repro (reading 'show') problem. Happens on useEnvironmentExtension route, with command as activation in new fresh terminal shift+enter.

    /cc Eleanor Boyd (@eleanorjboyd) for environment, poetry related

  12. locked as resolved and limited conversation to collaborators on Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-activationIssue related to activation. Root cause can be from interpreter selection or activation in terminalarea-terminalEnvironment extension specific terminal issues.bugIssue identified by VS Code Team member as probable bugcandidateIssue identified as probable candidate for fixing in the next releaseimportantIssue identified as high-priorityverifiedVerification succeeded

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions