Skip to content

Linux desktop entry bypasses /usr/bin/code wrapper and causes extension initialization failures #326580

Open

Description

@nckirik

Does this issue occur when all extensions are disabled?: No

  • VS Code Version: 1.128.0 - 1.129.1
  • OS Version: Linux Mint 22.1 x64; also reproduced on KDE Neon x64

Steps to Reproduce:

  1. Install VS Code from the official Linux package and install the OpenAI Codex extension.

  2. Launch VS Code using the packaged desktop entry from the application menu or a pinned launcher.

  3. Open the Codex panel.

  4. Observe that Codex remains stuck during startup. Its output stops after:

    Activating Codex extension
    [CodexMcpConnection] Spawning codex app-server
    [IpcRouter] I am the router
    [CodexMcpConnection] Initialize received id=1
    
  5. Fully close VS Code.

  6. Launch the same VS Code installation, profile, workspace, and extension from a terminal using:

    code .
  7. Observe that Codex initializes successfully.

The packaged desktop entry launches:

Exec=/usr/share/code/code %F
Exec=/usr/share/code/code --new-window %F

The URL handler also uses:

Exec=/usr/share/code/code --open-url %U

However, the shell command resolves through the wrapper:

/usr/bin/code
→ /usr/share/code/bin/code

Changing the desktop entry to use:

Exec=/usr/bin/code %F
Exec=/usr/bin/code --new-window %F

fixes the problem immediately.

This was reproduced independently on both Linux Mint and KDE Neon. It affects local workspaces and VS Code Remote-SSH sessions.

The following troubleshooting steps did not resolve it:

  • reinstalling the Codex extension
  • using fresh VS Code user-data and extensions directories
  • testing empty and small repositories
  • clearing VS Code profile state
  • reinstalling extensions

The same profile and extension succeed or fail solely depending on whether VS Code is launched through /usr/bin/code or directly through /usr/share/code/code.

Expected behavior:

Launching VS Code from the packaged desktop entry should be functionally equivalent to launching it through /usr/bin/code, including extension initialization behavior.

Activity

  1. nckirik commented on Jul 21, 2026

    @nckirik
    Author

    Workaround

    Override the packaged desktop entry to invoke /usr/bin/code:

    mkdir -p ~/.local/share/applications
    
    cp /usr/share/applications/code.desktop \
       ~/.local/share/applications/code.desktop
    
    sed -i \
      's|Exec=/usr/share/code/code |Exec=/usr/bin/code |g' \
      ~/.local/share/applications/code.desktop
    
    update-desktop-database ~/.local/share/applications 2>/dev/null || true

    Then remove and re-pin the VS Code launcher, or log out and back in so the desktop environment reloads the user-level entry.

  2. crliu3227 commented on Jul 22, 2026

    @crliu3227

    Workaround

    Override the packaged desktop entry to invoke /usr/bin/code:

    mkdir -p ~/.local/share/applications

    cp /usr/share/applications/code.desktop
    ~/.local/share/applications/code.desktop

    sed -i
    's|Exec=/usr/share/code/code |Exec=/usr/bin/code |g'
    ~/.local/share/applications/code.desktop

    update-desktop-database ~/.local/share/applications 2>/dev/null || true
    Then remove and re-pin the VS Code launcher, or log out and back in so the desktop environment reloads the user-level entry.

    It seems not work for Remote SSH?

  3. erikinkinen commented on Oct 24, 2026

    @erikinkinen

    Bypassing the increased handle limit setup in the wrapper can also cause the Git file monitor to stop working on larger codebases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions