2.7 KiB
2.7 KiB
| id | type | title | tags | importance | confidence | created | updated | relations | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 66bac9cf-1b1e-42f5-903d-d28a9d5e1e1a | decision | Fish + bash hybrid shell strategy: fish interactive, bash for scripts/tools |
|
0.6 | 0.8 | 2026-02-27T05:33:08.745935+00:00 | 2026-03-01T22:02:48.107795+00:00 |
|
Fish + Bash Hybrid Shell Strategy
Decision
Use fish as the interactive shell for its superior autocompletion and syntax highlighting, while keeping bash as the script executor for all tooling.
Implementation
Set set -x SHELL /bin/bash inside fish's config.fish. This makes $SHELL report /bin/bash to any tool that checks it (Claude Code, scripts, CI helpers) even though the interactive session is running under fish.
Rationale
- Fish provides excellent interactive UX: autosuggestions, syntax highlighting, smart completions — out of the box, no plugins needed
- Fish is POSIX-incompatible, so it cannot safely be used as a script executor
- Bash is the lingua franca for scripts — universally compatible, no subtle edge cases
- Zsh was considered as alternative (nearly POSIX-compatible + plugins like zsh-autosuggestions + zsh-syntax-highlighting), but "nearly" POSIX-compatible creates subtle issues and requires plugin management overhead
Affected Tools
- Claude Code Bash tool: uses
$SHELL→ gets bash, works correctly - Shell scripts with
#!/bin/bash: unaffected by interactive shell choice - Starship prompt: works identically in fish, zsh, bash
Trade-offs
- Fish config syntax (
set -x VAR val,if status is-interactive) must be learned — it is not bash-compatible - Two shell configs to potentially maintain (
~/.config/fish/config.fishfor interactive, and any bash rc for login/script contexts) - Benefit: interactive experience is dramatically better than plain zsh without plugins