Skip to content

Instantly share code, notes, and snippets.

@puffnfresh
Created February 19, 2014 02:09
Show Gist options
  • Save puffnfresh/9084791 to your computer and use it in GitHub Desktop.
Save puffnfresh/9084791 to your computer and use it in GitHub Desktop.
Put sandbox status in ZSH prompt
function cabal_sandbox_info() {
cabal_files=(*.cabal(N))
if [ $#cabal_files -gt 0 ]; then
if [ -f cabal.sandbox.config ]; then
echo "%{$fg[green]%}sandboxed%{$reset_color%}"
else
echo "%{$fg[red]%}not sandboxed%{$reset_color%}"
fi
fi
}
RPROMPT="\$(cabal_sandbox_info) $RPROMPT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment