having-so-much-fun-enjoying-cmdline-emoji

命令行里加个小表情足以愉悦自己
当git工作区不是”working tree clean”状态时 放出小表情

实现方法:

1
2
3
4
5
6
7
8
# $HOME/.zshrc
# env: MacOS

ZSH_THEME="ys"
function parse_git_dirty {
command git rev-parse --is-inside-work-tree &> /dev/null && [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working tree clean" ]] && echo "🤣"
}
export PS1='%n@%m:%1~%$(__git_ps1 " (%s)")$(parse_git_dirty)$ ' # with git branch, 配合 iterm的(smart selection)