Avoid ugly prompt on consoles

Fri, 18 Mar 2016 00:07:12 +0000

author
Meredith Howard <mhoward@roomag.org>
date
Fri, 18 Mar 2016 00:07:12 +0000
changeset 276
b9c8bfdfe163
parent 275
c636b6086bb2
child 277
5a1849a8608a

Avoid ugly prompt on consoles

.oh-my-zsh.cust/themes/mhoward.zsh-theme file | annotate | diff | comparison | revisions
--- a/.oh-my-zsh.cust/themes/mhoward.zsh-theme
+++ b/.oh-my-zsh.cust/themes/mhoward.zsh-theme
@@ -19,16 +19,16 @@
 
 # Customizable parameters.
 PROMPT_PATH_MAX_LENGTH=30
-PROMPT_DEFAULT_END=❯
-PROMPT_ROOT_END=❯❯❯
+PROMPT_DEFAULT_END='❯'
+PROMPT_ROOT_END='❯❯❯'
 PROMPT_SUCCESS_COLOR=$FG[071]
 PROMPT_FAILURE_COLOR=$FG[124]
 PROMPT_VCS_INFO_COLOR=$FG[242]
 
-if ! [[ $LC_CTYPE =~ 'UTF-8$' ]]
+if [[ ! $LC_CTYPE =~ 'UTF-8$' || "$(print -P %l)" =~ '^[0-9v]' ]]
 then
-  PROMPT_DEFAULT_END=\$
-  PROMPT_ROOT_END=\#
+  PROMPT_DEFAULT_END='%%'
+  PROMPT_ROOT_END='#'
 fi
 
 # Set required options.

mercurial