Skip to content

Instantly share code, notes, and snippets.

@jhrr
Created April 20, 2014 13:45
Show Gist options
  • Save jhrr/11114501 to your computer and use it in GitHub Desktop.
Save jhrr/11114501 to your computer and use it in GitHub Desktop.
Courtesy of Brian McKenna a zsh script to show the sandbox status of the current directory in our shell -- http://dev.stephendiehl.com/hask/
# a zsh script to show the sandbox status of the current directory in our shell.
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