Skip to content

[BUG] macOS desktop app does not inherit SSH_AUTH_SOCK from login shell when launched outside Terminal #971

Closed

Description

@stickerdaniel

Problem

On macOS, the desktop app repairs PATH from the user’s login shell during startup, but it does not hydrate other shell-provided environment variables.

That means if T3 Code is launched from Finder or the Dock, it can miss SSH_AUTH_SOCK even though the same machine and repo work correctly from Terminal. In practice, Git operations that rely on an SSH agent can fail inside the desktop app while succeeding in a login shell.

Relevant code paths:

  • apps/desktop/src/fixPath.ts
  • packages/shared/src/shell.ts

Reproduction

  1. On macOS, configure a repo to use a Git remote over SSH.
  2. Use an SSH agent setup that exposes auth through SSH_AUTH_SOCK in the login shell.
  3. Launch T3 Code from Finder or the Dock, not from Terminal.
  4. Trigger a Git operation from the desktop app that needs SSH auth.

Actual

The desktop app process can be missing SSH_AUTH_SOCK, so Git/SSH auth fails even though the same repo works from Terminal.

Expected

The macOS desktop app should sync the relevant shell environment needed for Git/SSH behavior, not just PATH, so Git operations behave consistently with a normal login shell.

Proposed Scope

Small, focused bug fix:

  • Extend the existing macOS shell-env bootstrap to read SSH_AUTH_SOCK alongside PATH
  • Preserve the current fallback behavior if shell environment lookup fails
  • Keep the change desktop-scoped and avoid unrelated shell/bootstrap refactors

Why This Matters

This is a reliability issue in normal desktop usage. Launching from Finder is a standard macOS path, and Git auth should not depend on whether the app was started from Terminal.

Activity

  1. omarcresp commented on Mar 12, 2026

    @omarcresp

    Same issue, it happens to me in linux too. I'll try the launch from terminal workaround thanks for mentioning it

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions