Skip to content

[Bug]: Ubuntu 26.04 - AppImage ARGV0 leak corrupts zsh integrated terminal - causes coreutils crashes #2509

Closed as not planned

Description

@jtannas

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Install T3 Code via AppImage on Ubuntu 26.04 (technically 25.10+ or any Linux distro using uutils/coreutils as the system default)
  2. Use zsh as your shell
  3. Open the integrated terminal

Expected behavior

The integrated terminal opens with no errors.

Actual behavior

The terminal starts up with a collection of crashes from core utility functions

  • mkdir
  • tee
  • dircolors

Impact

Major degradation or frequent failure

Version or commit

0.0.21

Environment

Ubuntu 25.10+, zsh, T3 Code AppImage

Logs or stack traces

Security violation: Requested utility `T3-Code-0.0.21-x86_64_8927ef5ff36264d996945c146d42b49c` does not match executable name:
  /usr/lib/cargo/bin/coreutils/mkdir
Security violation: Requested utility `T3-Code-0.0.21-x86_64_8927ef5ff36264d996945c146d42b49c` does not match executable name:
  /usr/lib/cargo/bin/coreutils/dircolors
Security violation: Requested utility `T3-Code-0.0.21-x86_64_8927ef5ff36264d996945c146d42b49c` does not match executable name:
  /usr/lib/cargo/bin/coreutils/tee
mise ERROR T3-Code-0.0.21-x86_64_8927ef5ff36264d996945c146d42b49c.AppImage is not a valid shim. This likely means you uninstalled a tool and the shim does not point to anything. Run `mise use <TOOL>` to reinstall the tool.
mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information
[ERROR]: gitstatus failed to initialize.

Screenshots, recordings, or supporting files

No response

Workaround

Add this to the very top of ~/.zshrc:

# T3 Code AppImage leaks ARGV0 into terminal sessions (see github.com/pingdotgg/t3code/issues/2509)
unset ARGV0

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on May 5, 2026
  2. jtannas commented on May 5, 2026

    @jtannas
    Author

    Mechanism (for maintainers)

    Dug into this with Claude Code — sharing the findings in case it helps someone fix it faster.

    The AppImage runtime sets ARGV0 to the AppImage filename before launching the Electron process. T3 Code inherits this and passes it unmodified to the terminal shell (the same gap PR #44 partially addressed for PORT, ELECTRON_*, and VITE_*).

    zsh has a feature where an exported ARGV0 is used as argv[0] for child processes it spawns. Since Ubuntu 25.10, the system coreutils default is uutils — a Rust reimplementation — which includes an identity security check that rejects mismatched argv[0] values and exits with code 1. This turns a silent env leak into hard crashes.

    The cascade:

    1. ARGV0 = T3-Code-....AppImage leaks into the terminal shell
    2. zsh passes it as argv[0] to every child process it spawns during startup
    3. dircolors fails → oh-my-zsh can't set up LS_COLORS
    4. mkdir fails → gitstatus can't create its cache directory → can't download its daemon binary → gitstatus fails to initialise
    5. mise shims receive the AppImage filename as their own name → mise can't identify which tool to proxy → mise errors on every managed CLI
    6. tee fails → anything piping through tee during startup breaks silently

    The errors in the logs aren't independent — they're a chain from a single leaked variable.

    Suggested fix (mirroring PR #44's approach, in apps/server/src/terminal/Layers/NodePTY.ts):

    Strip ARGV0, APPIMAGE, APPDIR, and OWD from the environment before spawning the terminal shell, and filter any /tmp/.mount_* entries from PATH and LD_LIBRARY_PATH.

    Related: #1699 describes the same root cause with softer symptoms (wrong PHP_BINARY) on older Ubuntu where GNU coreutils silently tolerate the bad argv[0].

  3. juliusmarminge commented on Jun 9, 2026

    @juliusmarminge
    Member

    Closing as a duplicate of #1699. Both track AppImage launcher environment contamination leaking into integrated terminals; #1699 is the canonical thread for sanitizing those variables.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.duplicateThis issue or pull request already existsneeds-triageIssue needs maintainer review and initial categorization.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions