microsoft / microsoft/vscode

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

Open
#326,580 2 comments 0 reactions 1 assignee Claimed by @rzhao271 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

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:

```text
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:

```bash
code .
```

7. Observe that Codex initializes successfully.

The packaged desktop entry launches:

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

The URL handler also uses:

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

However, the shell command resolves through the wrapper:

```text
/usr/bin/code
→ /usr/share/code/bin/code
```

Changing the desktop entry to use:

```text
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.