anomalyco / anomalyco/opencode

Integrated terminal leaks ARGV0 to shell, breaking rustup/cargo on Linux AppImage

Open
#40,839 0 comments 0 reactions 1 assignee View on GitHub

@Brendonovich is already working on this.

Since Aug 6, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Environment

  • OpenCode Desktop: 1.18.11
  • Platform: Linux
  • Distribution: CachyOS (likely affects any Linux distribution)
  • Installation: AppImage

Description

The integrated terminal inherits the ARGV0 environment variable from the AppImage launcher.

This causes rustup to misidentify itself and breaks all Rust proxy tools (cargo, rustc, rustfmt, cargo clippy, etc.) with the following error:

error: unknown proxy name: 'ai-opencode-desktop'; valid proxy names are 'rustc', 'rustdoc', 'cargo', ...

Steps to reproduce

  1. Launch OpenCode Desktop (AppImage).
  2. Open the integrated terminal.
  3. Run:
echo "$ARGV0"

Output:

/home/<user>/.local/share/bin/ai-opencode-desktop.AppImage
  1. Run:
cargo --version

Result:

error: unknown proxy name: 'ai-opencode-desktop'

Expected behavior

The integrated terminal should not propagate ARGV0 from the AppImage launcher into child shell sessions, as it breaks applications (such as rustup) that intentionally inspect this variable.

Running cargo --version should simply output the Cargo version.

Workaround

unset ARGV0
cargo --version

After unsetting ARGV0, Cargo and the rest of the Rust toolchain work normally.

Additional information

This appears to be the same class of issue previously seen in other Electron-based applications where ARGV0 leaked into the integrated terminal environment.

Filtering or unsetting ARGV0 before spawning the integrated shell should resolve the issue.

Plugins

No response

OpenCode version

1.18.11

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.