Skip to content

[Bug]: macOS login shell sync misses Homebrew and other env vars, causing terminal command errors #1465

@frittlechasm

Description

@frittlechasm

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
Impact: Minor bug or occasional failure
Version or commit: All Versions
Environment : macOS 26.2, Homebrew 5.1.1, zsh 5.9 (arm-apple-darwin25.0.0)

Steps to reproduce


Setup:

This issue happens when you are:

  • On the desktop version of T3Code on MacOS running zshrc shell
  • Have HomeBrew setup
  • Have zshrc plugins setup via homebrew
  • or have $HOMEBREW_PREFIX referenced as path in your ~/.zhsrc

Steps:

  1. Start the desktop app with the latest version (0.0.14)
  2. Open any old or new thread and then open the terminal
  3. Terminal opens and works but you see the following error message
Image

Reason for the issue:


From the code in readEnvironmentFromLoginShell & readPathFromLoginShell we are calling the shell to fetch variables but copying only PATH and in some places SSH_AUTH_SOCK . Homebrew variables are not included.

NOTE: Though adding Homebrew to the list might fix this related issue but other variables that might be defined in ~/.zprofile might get missed.

Logs or stack traces


@t3tools/desktop:dev: dev:electron | 16:33:53.298 EVENT [ws] outgoing
  push channel="terminal.event" sequence=17 recipients=1 payload=
  {
    "type": "output",
    "threadId": "db9abf8f-e027-4970-a3f5-9b621f54c7a7",
    "terminalId": "default",
    "createdAt": "",
    "data": "/Users/frittlechasm/.zshrc:source:136: no such file or
  directory: /share/zsh-autosuggestions/zsh-autosuggestions.zsh\r\n/User
  s/frittlechasm/.zshrc:source:137: no such file or directory:
  /share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh\r\n"
  }

Workaround


Add HOMEBREW_PREFIX to the allow list in readEnvironmentFromLoginShell

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.needs-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