@fgladisch/pi-zsh-shell
v0.2.1
Published
Run Pi user bash commands through zsh with Pi-specific functions
Readme
@fgladisch/pi-zsh-shell
Run Pi user bash commands through zsh while sourcing Pi-specific shell functions from ~/.pi/agent/zsh-functions.
What it does
This extension hooks Pi's user_bash execution and wraps each command in:
exec /bin/zsh -fc 'if [ -r ~/.pi/agent/zsh-functions ]; then source ~/.pi/agent/zsh-functions; fi
<your command>'zsh -f keeps startup fast and avoids loading interactive config such as ~/.zshrc, prompt plugins, Powerlevel10k, or gitstatus.
Pi zsh functions
Create ~/.pi/agent/zsh-functions for helpers you want available inside Pi commands:
gst() {
git status "$@"
}
ll() {
ls -lah "$@"
}The file is sourced only when readable. Missing file is ignored.
Prefer functions over aliases. Functions work reliably in this non-interactive zsh -f -c flow, while aliases are parsed earlier and can be surprising.
Shell selection
By default the extension uses:
PI_ZSH_SHELL, if set to an absolute path$SHELL, when it is an absolute path and its basename iszsh/bin/zsh
Example:
export PI_ZSH_SHELL=/opt/homebrew/bin/zsh