Skip to content

Commit

Permalink
Implemented UTF-8 support in fishy.zsh-theme.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbohdan committed Apr 12, 2013
1 parent 85426a5 commit 2d2aa64
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions themes/fishy.zsh-theme
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# ZSH Theme emulating the Fish shell's default prompt.

_fishy_collapsed_wd() {
echo $(pwd | perl -pe "s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g")
}
echo $(pwd | perl -pe "
BEGIN {
binmode STDIN, ':encoding(UTF-8)';
binmode STDOUT, ':encoding(UTF-8)';
}; s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g
")
}

local user_color='green'; [ $UID -eq 0 ] && user_color='red'
PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) '
Expand Down

0 comments on commit 2d2aa64

Please sign in to comment.