feat: add experimental fish shell option#74
Conversation
Extends the shell picker in setup.sh with a third choice (fish), alongside the existing bash and zsh options. Also drops "(experimental)" from the Shell section header since the tag now lives on the individual options. Fish install: - apt-get install fish - Writes ~/.config/fish/config.fish mirroring the default bashrc in fish-native syntax (starship, zoxide, aliases, EDITOR, PATH). - Translates the user's ~/.squarebox-ai-aliases, -editor-aliases, -tui-aliases, and -sdk-paths bash files into a single ~/.config/fish/conf.d/squarebox-selections.fish at install time via a small bash→fish line translator (export PATH=… → set -x PATH …, other exports → set -x, aliases pass through, unsupported constructs like nvm sourcing are dropped). Handoff: - New ~/.squarebox-use-fish marker (parallel to the zsh one) triggers `exec fish -l` from bashrc. SQUAREBOX_IN_FISH guards re-exec loops; SQUAREBOX_NO_FISH forces bash for a single session. Docs + test: - README Shell section documents fish and flags the known nvm-in-fish limitation (nvm.fish plugin required). - squarebox-setup.sh help text mentions fish. - e2e-test.sh clears both markers before asserting selection state. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds fish as an additional (experimental) default shell option in squarebox, alongside bash and zsh, including install/hand-off behavior and documentation updates.
Changes:
- Extend
setup.shshell selection to include fish, install it via apt, and generate~/.config/fish/config.fishplus a translatedconf.d/squarebox-selections.fish. - Add a fish hand-off stanza to
.bashrcgeneration in theDockerfile(marker-basedexec fish -l). - Update CLI help text, README docs, and e2e setup marker cleanup to account for the new fish option.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.sh | Adds fish to shell selection, installs fish, generates fish config, and translates ~/.squarebox-* bash snippets to fish. |
| scripts/squarebox-setup.sh | Updates help text to mention fish as an experimental shell option. |
| scripts/e2e-test.sh | Clears fish marker in suite setup to avoid stale state impacting assertions. |
| README.md | Documents fish option, generated config paths, and fish-specific limitation (nvm). |
| Dockerfile | Adds .bashrc hand-off to fish via ~/.squarebox-use-fish marker, mirroring the zsh flow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # highlighting, so no plugins are needed. | ||
| cat > "$HOME/.config/fish/config.fish" <<-'FISHRC' || return 1 | ||
| # squarebox fish config (experimental) — mirrors ~/.bashrc | ||
| status is-interactive; or exit 0 |
There was a problem hiding this comment.
In fish, config.fish is sourced during startup; using exit 0 here can terminate the shell entirely for non-interactive invocations (e.g., fish -c ...) rather than just skipping interactive-only setup. Prefer status is-interactive; or return (or wrap the interactive config in if status is-interactive ... end) so non-interactive fish commands keep working.
| status is-interactive; or exit 0 | |
| status is-interactive; or return |
| # Ensure stale markers from a previous run are cleared so the assertion | ||
| # below reflects the current selection, not leftover state. | ||
| rm -f ~/.squarebox-use-zsh | ||
| rm -f ~/.squarebox-use-zsh ~/.squarebox-use-fish |
There was a problem hiding this comment.
The suite now clears both ~/.squarebox-use-zsh and ~/.squarebox-use-fish, but the assertion later in this suite still only checks that the zsh marker is absent for a bash selection. Please also assert that the fish marker is not present, so the test actually catches regressions where bash selection accidentally leaves/creates the fish handoff marker.
- setup.sh: use `status is-interactive; or return` instead of `exit 0` in the generated config.fish. `exit` terminates the whole shell for non-interactive invocations like `fish -c '…'`; `return` only exits the current sourced config context. - scripts/e2e-test.sh: add a 3.12c assertion that the bash selection leaves no fish handoff marker, matching the existing zsh marker check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts: # scripts/squarebox-setup.sh
Summary
setup.sh, flagged as experimental.(experimental)from the Shell section header since the tag now lives on the individual options.~/.config/fish/config.fishmirroring the default bashrc (starship, zoxide, aliases, EDITOR, PATH), plus a translatedconf.d/squarebox-selections.fishbuilt from the user's existing~/.squarebox-ai-aliases,-editor-aliases,-tui-aliases, and-sdk-pathsbash files.~/.squarebox-use-fishmarker causes~/.bashrctoexec fish -l;SQUAREBOX_IN_FISHguards re-exec loops,SQUAREBOX_NO_FISHforces bash for one session.Why
Fish is the most-requested alternative after zsh — built-in autosuggestions and syntax highlighting with no plugins required. Existing users who prefer fish had to configure it manually.
Notes for reviewers
_squarebox_bash_line_to_fishinsetup.sh): handlesexport PATH="A:B:\$PATH"→set -x PATH A B \$PATH, otherexport NAME=…→set -x NAME …, and passesalias …lines through (fish 3+ acceptsalias foo='bar'). Lines it can't translate (the nvm[ -s … ] && . …sourcing, etc.) are dropped on purpose — see the known limitation below.export.Test plan
sqrbx-setup shell→ pick fish → exit/re-enter → lands in fish with prompt, aliases, and selected EDITOR workingsqrbx-setup shell→ switch back to bash → marker removed, next shell is bashSQUAREBOX_NO_FISH=1 bash -l(with marker present) → stays in bashcat ~/.config/fish/conf.d/squarebox-selections.fish→ contains the expected translated entries for the current selections🤖 Generated with Claude Code