Skip to content

fix(core): clear ARGV0 before spawning terminals - #49277

Open
zonemeen wants to merge 1 commit into
anomalyco:devfrom
zonemeen:fix/terminal-argv0
Open

zonemeen wants to merge 1 commit into
anomalyco:devfrom
zonemeen:fix/terminal-argv0

Conversation

@zonemeen

Copy link
Copy Markdown

Issue for this PR

Closes #40839

Type of change

  • Bug fix

What does this PR do?

AppImage sets ARGV0 to its executable path. When inherited by zsh, it overrides child commands' argv[0], causing Rustup proxies such as cargo and rustc to fail with unknown proxy name in the integrated terminal.

  • Remove ARGV0 from the PTY environment before spawning the shell.
  • Add a regression test that checks ARGV0 is removed while preserving terminal variables and the parent process environment.

How did you verify your code works?

  • Confirmed the new regression test fails before the fix and passes after it.
  • Built and ran before/after Linux ARM64 AppImages under Xvfb using --appimage-extract-and-run. Through the bundled backend's PTY API, verified that cargo --version, rustc --version, and an offline Rust program fail before the fix and succeed after it.
  • Passed 25 PTY/Shell tests on both macOS and Linux. One existing Linux lifecycle test initially timed out and passed on rerun.
  • Passed core type checks, formatting checks, and git diff --check.

Screenshots / recordings

Rendered from captured AppImage PTY output; command labels added and long valid-proxy lists omitted.

Before After
Rustup commands fail with unknown proxy name Cargo, rustc and an offline Rust program succeed)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant