42127bee6d80a86446c4961ebcc1a68cb2f14261

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #1715 from dbohdan/master

Fixed a UTF-8 problem in the theme "fishy"

Diff

 1diff --git a/themes/fishy.zsh-theme b/themes/fishy.zsh-theme
 2index e9f78a54e426b92a457306049b578bc58b135aab..8b24172a2e742494de54c28b19f781abd756eb87 100644
 3--- a/themes/fishy.zsh-theme
 4+++ b/themes/fishy.zsh-theme
 5@@ -1,8 +1,13 @@
 6 # ZSH Theme emulating the Fish shell's default prompt.
 7 
 8 _fishy_collapsed_wd() {
 9-  echo $(pwd | perl -pe "s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g")
10-}
11+  echo $(pwd | perl -pe "
12+   BEGIN {
13+      binmode STDIN,  ':encoding(UTF-8)';
14+      binmode STDOUT, ':encoding(UTF-8)';
15+   }; s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g
16+")
17+} 
18 
19 local user_color='green'; [ $UID -eq 0 ] && user_color='red'
20 PROMPT='%n@%m %{$fg[$user_color]%}$(_fishy_collapsed_wd)%{$reset_color%}%(!.#.>) '