Cursor AppImage ignores Python virtual environment when using zsh, defaults to bundled Python

Describe the Bug

When using zsh as the default shell, Cursor AppImage ignores configured Python virtual environments and always uses its bundled Python interpreter (/opt/cursor.appimage).
Switching to bash makes Cursor correctly respect the venv.

This suggests a Cursor vs zsh compatibility issue on Linux.

Steps to Reproduce

  1. Create a new project folder and set up a venv:

    python3 -m venv .venv
    source .venv/bin/activate
    pip install requests
    
  2. Create .vscode/settings.json:

    {
        "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python"
    }
    
  3. Open the folder in Cursor (AppImage build) with zsh as the integrated shell.

  4. Run inside Cursor:

    import sys, pathlib
    print("Executable:", sys.executable)
    print("In venv?", ".venv" in pathlib.Path(sys.executable).parts)
    print("sys.path:", sys.path)
    
  5. Observe that sys.executable is /opt/cursor.appimage, not the .venv interpreter.

  6. Switch integrated shell to bash and repeat step 4:

    • sys.executable now correctly points to .venv/bin/python.

Expected Behavior

Cursor should respect "python.defaultInterpreterPath" and use the project’s .venv/bin/python, regardless of the integrated shell.


Actual Behavior

  • With zsh: Cursor always uses /opt/cursor.appimage and ignores .venv.
  • With bash: Cursor correctly uses .venv/bin/python.
  • Integrated terminal activates .venv, but code execution still runs via the bundled Python.

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

  • Cursor: 1.2.4
  • VSCode Core: 1.99.3 (commit a8e95743c5268be73767c46944a71f4465d05c90)
  • Electron: 34.5.1
  • Chromium: 132.0.6834.210
  • Node.js: 20.19.0
  • V8: 13.2.152.41-electron.0
  • OS: Ubuntu 24.04.2 LTS x64 (Linux 6.14.0-24-generic)
  • Python in project venv: 3.12.3
  • Default shell: zsh (/usr/bin/zsh)

Additional Information


Quick Diagnostic Section

Run inside Cursor (zsh):

import sys, pathlib, os
print("Executable:", sys.executable)
print("In venv?", ".venv" in pathlib.Path(sys.executable).parts)
print("PATH:", os.environ.get("PATH"))
print("VIRTUAL_ENV:", os.environ.get("VIRTUAL_ENV"))

Then repeat in bash.
Difference: with bash, sys.executable uses .venv/bin/python; with zsh, it falls back to /opt/cursor.appimage.


Workarounds Tried

  • Setting "python.defaultInterpreterPath" and "python.venvPath".

  • Enabling "python.terminal.activateEnvironment": true.

  • Activating .venv manually in integrated terminal.

  • Restarting Cursor and OS.

  • Hardcoding venv path in .vscode/settings.json.

  • Running Cursor with PATH modified to include .venv/bin first.

  • Verified venv works correctly in external terminal (sys.executable points to .venv/bin/python).

  • Changing integrated shell:

    • zsh: always uses /opt/cursor.appimage.
    • bash: correctly uses .venv/bin/python.

Possible Cause / Developer Notes

  • Likely a zsh-related environment inheritance issue:

    • Cursor’s AppImage doesn’t correctly pick up PATH or VIRTUAL_ENV under zsh.
    • With bash, environment propagation works as expected.
  • Could be related to how AppImage launches subprocesses or differences in initialization between bash and zsh.


Impact

  • Prevents using project-specific Python packages in zsh.
  • Makes Cursor inconsistent with both bash and standard VS Code behavior.
  • Requires either changing shell to bash or patching Cursor startup scripts to work around.

Does this stop you from using Cursor

Yes - Cursor is unusable

Hi! I’m also affected by this issue. It makes cursor practically unusable for my specific case.
How do these bug reports work? I’ve seen several threads regarding this issue and most have been automatically closed without any official reply from the Cursor team as to whether they’ve registered this as a bug or not.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.