Skip to content

feat(settings): configurable shell command for new terminals - #133

Open
andrewheumann wants to merge 1 commit into
collabs-inc:mainfrom
andrewheumann:feat/configurable-shell
Open

feat(settings): configurable shell command for new terminals#133
andrewheumann wants to merge 1 commit into
collabs-inc:mainfrom
andrewheumann:feat/configurable-shell

Conversation

@andrewheumann

Copy link
Copy Markdown

Summary

Adds a "Shell command" field in Settings → Terminal that overrides the binary launched for new terminal sessions. Useful for users who want Collaborator to spawn fish, nushell, a non-default bash, etc. without changing their system login shell.

Empty value falls back to $SHELL (existing behavior), so this is purely additive — no effect for users who don't opt in.

Changes

  • New ui.terminalCommand pref (string; empty/unset = default).
  • resolveShellPath() in terminal-target.ts centralizes the lookup: config override (if it resolves on PATH) → $SHELL → platform
    default. If the configured binary isn't found, new terminals silently fall back instead of spawning-and-failing.
  • Both PTY paths consume it:
    • Sidecar via the existing resolveTerminalTarget() call.
    • tmux by passing the resolved shell as the trailing arg to tmux new-session (previously tmux fell back to its default-shell,
      ignoring the config).
  • Settings UI: text input above the backend radio. Commits on blur / Enter. Accepts a name on PATH (e.g. fish) or an absolute path (e.g.
    /bin/bash). Live-validates against which; a missing binary shows a red outline + inline hint so the fallback behavior is never
    surprising.
  • New IPC terminal:check-shell-command backing the validation.

Test plan

  • Leave the field empty → new terminals spawn $SHELL as before.
  • Set to fish (on PATH) → new terminals spawn fish. Tile title shows fish.
  • Set to /bin/bash → new terminals spawn bash.
  • Set to /nope/does-not-exist → input shows red "Not found on PATH" hint; new terminals fall back to default (no open-then-close).
  • Toggle backend between node-pty and tmux and verify the override applies in both.

Adds a "Shell command" input under Settings → Terminal that overrides
the binary launched for new PTY sessions. Empty value falls back to
$SHELL (current behavior), letting users point Collaborator at fish,
nushell, or a non-default bash/zsh without changing the system login
shell.

The override is applied through a single resolveShellPath() helper in
terminal-target.ts, consumed by both the sidecar and tmux code paths
in pty.ts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@yiliush

yiliush commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@andrewheumann

Copy link
Copy Markdown
Author

I have read the Contributor License Agreement (CLA) and hereby sign the CLA.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants