Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## Unreleased

### Added

- Setup offers PowerShell 7 (`pwsh`) as an alternative default shell, installed
from Microsoft's GitHub release `.deb` after its release-asset SHA-256 is
verified. A managed `~/.config/powershell/profile.ps1` mirrors the bashrc
(starship, zoxide, mise, aliases) and a `~/.squarebox-use-pwsh` marker hands
interactive logins off to pwsh, matching the existing Zsh/Fish flow.

## v1.2.1 — 2026-07-31

v1.2.0 was built as a draft Candidate but was never published after final
Expand Down
9 changes: 5 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Key rules:

- Preserve old Selection on prompt cancellation; intentional empty selection is distinct.
- Commit Selection/aliases from successful observed installs, not requested values.
- Keep Bash, Zsh, and Fish derived configuration synchronized after section reruns.
- Keep Bash, Zsh, Fish, and PowerShell derived configuration synchronized after section reruns.
- Respect explicit user configuration during migrations (for example tmux mouse off).
- Runtime APT must work with the read-only timezone mount and show actionable failures.
- `sqrbx-learn` and its command logger are not shipped in the default v1.1 Box.
Expand Down Expand Up @@ -137,9 +137,10 @@ Managed-home volume copies. Bind mounts remain host-managed and are skipped;
a symlink destination is rejected with a visible startup failure. Never follow
a persistent-home symlink as root.

Bash is default. Experimental Zsh/Fish are selected with markers in the Managed
home and must initialize Starship, Zoxide, the `fzf`/`ff` command path, aliases,
and mise. The packaged Ctrl+R/Ctrl+T/Alt+C/** bindings are a Bash-only contract.
Bash is default. Experimental Zsh/Fish/PowerShell are selected with markers in
the Managed home and must initialize Starship, Zoxide, the `fzf`/`ff` command
path, aliases, and mise. The packaged Ctrl+R/Ctrl+T/Alt+C/** bindings are a
Bash-only contract.

## Security posture

Expand Down
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ Installed during first-run setup. Choose any combination, or none:
### Shell (Experimental)

By default, squarebox uses Bash. During first-run setup you can opt in to
**Zsh** or **Fish** instead.
**Zsh**, **Fish**, or **PowerShell** instead.

**Zsh** installs:

Expand All @@ -324,14 +324,24 @@ autosuggestions and syntax highlighting built in. The generated
AI/editor/TUI/SDK selections are translated from their bash files into
`~/.config/fish/conf.d/squarebox-selections.fish` at setup time.

> **Experimental:** the marker file `~/.squarebox-use-zsh` (or
> `~/.squarebox-use-fish`) causes `~/.bashrc` to `exec` the chosen shell on
> every interactive login, so the next shell start picks up the new shell.
> Set `SQUAREBOX_NO_ZSH=1` or `SQUAREBOX_NO_FISH=1` to force bash for a single
> session, or re-run `sqrbx-setup shell` to switch back permanently. Tooling
> is primarily tested against bash, so a few edge cases may need polish —
> please file an issue if you hit one. SDK shims are wired into all three
> shells via `mise activate {bash,zsh,fish}`.
**PowerShell** installs PowerShell 7 (`pwsh`) from Microsoft's official
[GitHub release](https://github.com/PowerShell/PowerShell/releases) `.deb`
(asset SHA-256 verified against the release metadata before install). The
generated `~/.config/powershell/profile.ps1` mirrors the default bashrc in
PowerShell-native syntax — starship, zoxide, and mise activate, plus the
standard aliases as functions (PowerShell `Set-Alias` cannot attach
arguments); AI/editor/TUI selections are translated from their bash files into
`~/.config/powershell/squarebox-selections.ps1` at setup time.

> **Experimental:** the marker file `~/.squarebox-use-zsh`,
> `~/.squarebox-use-fish`, or `~/.squarebox-use-pwsh` causes `~/.bashrc` to
> `exec` the chosen shell on every interactive login, so the next shell start
> picks up the new shell. Set `SQUAREBOX_NO_ZSH=1`, `SQUAREBOX_NO_FISH=1`, or
> `SQUAREBOX_NO_PWSH=1` to force bash for a single session, or re-run
> `sqrbx-setup shell` to switch back permanently. Tooling is primarily tested
> against bash, so a few edge cases may need polish — please file an issue if
> you hit one. SDK shims are wired into all four shells via
> `mise activate {bash,zsh,fish,powershell}`.

### SDKs

Expand Down
2 changes: 1 addition & 1 deletion demo/setup-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ done <<< "$selected"
echo
section_header "Shell"
selected=$(gum choose --header "Select the default shell:" \
"bash" "zsh (experimental)" "fish (experimental)") || true
"bash" "zsh (experimental)" "fish (experimental)" "powershell (experimental)") || true
[ -n "$selected" ] && run_with_spinner "Configuring ${selected}..." 0.7

echo
Expand Down
8 changes: 8 additions & 0 deletions dotfiles/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,12 @@ if [ -f ~/.squarebox-use-fish ] && [ -z "${SQUAREBOX_IN_FISH:-}" ] && [ -z "${SQ
exec fish -l
fi

# Hand off to PowerShell if the user opted in via setup.sh (experimental).
# SQUAREBOX_IN_PWSH guards against re-exec loops; SQUAREBOX_NO_PWSH lets
# users force bash for one shell without removing the marker.
if [ -f ~/.squarebox-use-pwsh ] && [ -z "${SQUAREBOX_IN_PWSH:-}" ] && [ -z "${SQUAREBOX_NO_PWSH:-}" ] && command -v pwsh >/dev/null 2>&1; then
export SQUAREBOX_IN_PWSH=1
exec pwsh -l
fi

[ -x /usr/local/lib/squarebox/motd.sh ] && /usr/local/lib/squarebox/motd.sh
5 changes: 5 additions & 0 deletions scripts/e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,11 @@ suite_setup_editors() {
else
tap_fail "3.12c no fish marker for bash selection"
fi
if [ ! -e ~/.squarebox-use-pwsh ]; then
tap_ok "3.12d no pwsh marker for bash selection"
else
tap_fail "3.12d no pwsh marker for bash selection"
fi

# 4.4 EDITOR set to first selected editor (micro)
run_test_grep "4.4 EDITOR set to micro" "micro" cat ~/.squarebox-editor-aliases
Expand Down
4 changes: 4 additions & 0 deletions scripts/squarebox-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ box_reconcile_needed() {
command -v fish >/dev/null 2>&1 || return 0
[ -f "$managed_home/.config/fish/config.fish" ] || return 0
fi
if selection_contains "$state/shell" pwsh; then
command -v pwsh >/dev/null 2>&1 || return 0
[ -f "$managed_home/.config/powershell/profile.ps1" ] || return 0
fi
return 1
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/squarebox-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ usage() {
tuis TUI tools (lazygit, gh-dash, yazi, elio)
multiplexers Terminal multiplexers (tmux, zellij, herdr)
sdks SDKs (node, python, go, dotnet, rust)
shell Default shell (bash, zsh/fish — experimental)
shell Default shell (bash, zsh/fish/pwsh — experimental)

${BOLD}Examples:${RESET}
sqrbx-setup ai editors Re-run AI assistant and editor selection
Expand Down
Loading