Skip to content

Instantly share code, notes, and snippets.

@microft
Created April 9, 2020 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save microft/50466a39894e83a95210ccef57c9b310 to your computer and use it in GitHub Desktop.
Save microft/50466a39894e83a95210ccef57c9b310 to your computer and use it in GitHub Desktop.
smileyface in zsh PS1
function smileyface
{
case $? in
0 )
echo -ne "$fg[green] :)"
;;
1 )
echo -ne "$fg[red] ;("
;;* )
echo -ne "$fg[yellow] %%("
;;
esac
return 0
}
setopt PROMPT_SUBST
export PS1="%{$fg[red]%}%m%{$fg[white]%}%~%{$reset_color%}% \$(smileyface) %{$reset_color%}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment