setopt inc_append_history
setopt share_history
- PROMPT=$'%{\ek\e\\%}%{%(?.$fg[green].$fg[red])%}%B[%n@%m] %#%b %{$reset_color%}'
+ function _we_are_in_gnu_screen () {
+ [ "$WINDOW" != "" ]
+ }
+
-PROMPT=$'%{\ek\e\\%}%B[%n@%m] %#%b '
-RPROMPT='%U%?%u %U%D{%m/%d}%u %U%D{%T}%u %U%~%u'
++_prompt_base='%{%(?.$fg[green].$fg[red])%}%B[%n@%m] %#%b %{$reset_color%}'
++if ( _we_are_in_gnu_screen ); then
++ PROMPT=$'%{\ek\e\\%}'$_prompt_base
++else
++ PROMPT=$_prompt_base
++fi
++
+RPROMPT='%U%D{%m/%d}%u %U%D{%T}%u %U%~%u'
+
HISTFILE="$HOME/.zhistory"
HISTSIZE=6000000
SAVEHIST=6000000