Skip to content

Shell preference silently resets to system default after Homebrew upgrades the shell (canonicalized Cellar path breaks the match) #15836

Description

@thiagohflima

Pre-submit Checks

Describe the bug

On macOS, when a shell installed via Homebrew (e.g. fish) is selected in Settings → Features → "Default shell for new sessions", the preference silently reverts to the system default login shell (zsh) every time brew upgrade updates the shell formula.

To reproduce

  1. brew install fish and add /opt/homebrew/bin/fish to /etc/shells
  2. In Warp, set the default shell for new sessions to Fish
  3. Confirm that new sessions/tabs open fish
  4. Run brew upgrade fish
  5. Open a new Warp session → it starts zsh instead, and the setting has silently fallen back to the system default

Expected behavior

The shell preference survives a Homebrew upgrade of the shell. If the configured shell cannot be resolved, Warp should warn instead of silently falling back.

Screenshots, videos, and logs

No response

Operating system (OS)

macOS

Operating system and version

macOS Tahoe 26.6.2

Shell Version

fish 4.9.2 (Homebrew, /opt/homebrew/bin/fish)

Current Warp version

v0.2026.09.02.08.27.stable_01

Regression

No, this bug or issue has existed throughout my experience using Warp

Recent working Warp date

No response

Additional context

Root cause analysis against the open-source codebase (master):

  1. Warp canonicalizes shell paths during detection: resolve_all_executables and load_fallback_shells in app/src/terminal/available_shells.rs (lines 814-828 and 830-866) run dunce::canonicalize, resolving the stable Homebrew symlink /opt/homebrew/bin/fish to the versioned Cellar path /opt/homebrew/Cellar/fish/<version>/bin/fish.
  2. That versioned path is what gets persisted: selecting the shell stores NewSessionShell::Executable(<canonicalized path>) via From<AvailableShell> for NewSessionShell (available_shells.rs:346-352) in set_user_preferred_shell (available_shells.rs:590-626).
  3. On the next session start, matches_preference (available_shells.rs:207-222) compares the persisted path by exact string equality against the re-detected shells. After brew upgrade fish, Homebrew removes the old Cellar directory, and detection now canonicalizes to the new version's path → no match → get_user_preferred_shell hits .unwrap_or_default() (available_shells.rs:590-604) → SystemDefaultcompute_fallback_shell() → the login shell (zsh). All of this is silent; the user just finds themselves in a different shell.

Fix direction:

  • Primary: persist the pre-canonicalization (symlink) path discovered via PATH — e.g. /opt/homebrew/bin/fish, which is stable across Homebrew upgrades — and use the canonicalized path only as the dedupe key in resolve_all_executables / load_fallback_shells. Runtime validation (file_exists_and_is_executable) follows the live symlink, so launch keeps working across upgrades.
  • Defense in depth: when the exact persisted path no longer exists, re-resolve the preference by shell file name / parse_shell_type_from_path among currently detected shells instead of falling back to the system default. This also heals preferences that were already persisted with a stale Cellar path.

Happy to open a PR with a regression test simulating a Homebrew layout (bin/fish -> Cellar/fish/<old>/bin/fish, then re-pointing the symlink to a new version).

Does this block you from using Warp daily?

No

Is this an issue only in Warp?

Yes, I confirmed that this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e

None

Activity

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

Metadata

Metadata

Assignees

Labels

area:settings-keybindingsSettings UI, preferences, keybindings, and keyboard-shortcut management.area:shell-terminalTerminal input/output, shell integration, prompt behavior, and block rendering.bugSomething isn't working.factory-auto-implementQueued for automated implementation by the Warp factoryos:macmacOS-specific behavior, regressions, or requests.repro:highThe report includes enough evidence that the issue appears highly reproducible.triagedIssue has received an initial automated triage pass.warp:auto-triage-review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions