Add PowerShell as an optional default shell - #167
Open
BrettKinny wants to merge 1 commit into
Open
Conversation
Setup now offers PowerShell 7 (pwsh) alongside bash/zsh/fish as the Box default shell. The installer resolves the exact latest PowerShell GitHub release, picks the architecture-matching .deb, verifies its release-asset SHA-256 before download, and installs through apt so declared dependencies resolve. A generated ~/.config/powershell/profile.ps1 mirrors the bashrc in PowerShell syntax (starship/zoxide/mise activation plus aliases as functions, since Set-Alias cannot attach arguments), and AI/editor/TUI selections are translated into squarebox-selections.ps1 like the existing fish snippet. A ~/.squarebox-use-pwsh marker hands interactive logins off to pwsh via bashrc re-exec, matching the zsh/fish flow; the entrypoint reconciles a saved pwsh Selection when the binary or profile is missing from a Box. Tests cover metadata failure, digest mismatch, and the verified-install path through fault-injected fixtures, plus entrypoint reconcile state.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds PowerShell 7 (
pwsh) as a fourth option in setup's shell Selection, alongside the existing bash / zsh / fish.What changes
setup.sh— shell menu (gum + text) now offerspowershell (experimental); newinstall_pwsh:PowerShell/PowerShellGitHub release,.deb(amd64/arm64),apt_installso declared dependencies resolve under the existing sudo contract,~/.config/powershell/profile.ps1mirroring the bashrc (starship / zoxide / mise activation; aliases as PowerShell functions sinceSet-Aliascannot attach arguments),~/.config/powershell/squarebox-selections.ps1(mirrors the fish snippet flow).dotfiles/bashrc—~/.squarebox-use-pwshmarker →exec pwsh -lhandoff, withSQUAREBOX_NO_PWSHoverride; markers are now cleaned up mutually exclusively across all shells.scripts/squarebox-entrypoint.sh— a savedpwshSelection reconciles when the binary or managed profile is missing from a Box (Box-tier lifecycle), matching zsh/fish.sqrbx-setup --help, CLAUDE.md contract, demo recorder, CHANGELOG.Verification
pwsh, activation marker is exclusive, profile sources the selection snippet, install goes throughapt-get.podman build+scripts/e2e-test.sh smoke).profile.ps1was executed by realpwsh7.6.5 (extracted from the official.deb): loads cleanly, setsEDITOR, definesc/lg/lsas functions, runs motd.Notes
mise activate powershellandstarship init powershellboth emit valid PowerShell (verified), so profile activation uses them natively.