Skip to content

[Bug]: Shell environment capture runs interactive zsh without TTY/TERM, spamming gitstatus/zle/monitor/tput errors #3490

@bernardopg

Description

@bernardopg

Area

apps/desktop (shell environment resolution)

Steps to reproduce

  1. Use zsh as the login shell with a typical prompt stack (oh-my-zsh + powerlevel10k / gitstatus).
  2. Launch the desktop app.
  3. Inspect ~/.t3/userdata/logs/server-child.log.

Expected behavior

When the app resolves the shell environment (to import PATH etc.), it should not trip interactive-only shell machinery, and should not emit errors caused by running an interactive shell without a controlling TTY / TERM.

Actual behavior

The backend spawns the user's shell in an interactive context but without a TTY/TERM, so interactive-only init fails and spams errors on every launch:

(anon):setopt:7: can't change option: monitor
[ERROR]: gitstatus failed to initialize.
(eval):1: can't change option: zle
(eval):1: can't change option: zle
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified
...

monitor (job control), zle (line editor) and gitstatus are interactive/TTY-only; tput fails because TERM is unset. This is the same general area as #2509.

Impact

Minor / log noise, plus wasted work spinning up prompt machinery (gitstatusd, etc.) that is irrelevant to env capture.

Version or commit

0.0.27 (Linux AppImage, t3code-bin AUR package)

Environment

Arch Linux, Hyprland (Wayland), zsh + oh-my-zsh + powerlevel10k.

Logs or stack traces

See the block above (from server-child.log, stream: stderr, component: desktop-backend-child).

Workaround

Guard interactive-only init in the shell rc behind a TTY check, e.g. [[ ! -t 1 ]] && return (after exports/PATH, which in my setup live in .zshenv and are evaluated before this). After adding that guard the env capture is clean and instant.

Suggested fixes on the app side (either/both):

  • Set a sane TERM (e.g. dumb) when spawning the shell for env capture.
  • Expose a marker env var (like VS Code's VSCODE_RESOLVING_ENVIRONMENT=1) so users can guard heavy interactive init in their rc during env resolution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions