From 03b937c07a24eda318000684cd642eb31b9c3e54 Mon Sep 17 00:00:00 2001 From: alexg0 Date: Tue, 27 Jul 2010 13:42:19 -0500 Subject: [PATCH] alexg.theme for emacs --- themes/alexg.zsh-theme | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/themes/alexg.zsh-theme b/themes/alexg.zsh-theme index 6f4a4bd61..69289bb2e 100644 --- a/themes/alexg.zsh-theme +++ b/themes/alexg.zsh-theme @@ -5,11 +5,25 @@ # note: %F and %K dont work correctly on non-color terminals local return_code="%(?,,%{$fg[red]%}%? ↵%{$reset_color%})" -local prompt_char="%B%(!,#,»)%b" +local user_prompt_char="»" +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹" +ZSH_THEME_GIT_PROMPT_SUFFIX="›%{$reset_color%}" + +local prompt_char="%B%(!,#,$user_prompt_char)%b" local who_where="%(!,%{$fg[magenta]%}%n@%m,%{$fg[blue]%}%m)%{$reset_color%}" PROMPT='$(git_prompt_info abbr)%1(l, ,)$who_where %{$fg[cyan]%}%2~ %{$reset_color%}$prompt_char ' RPS1="${return_code}" -ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹" -ZSH_THEME_GIT_PROMPT_SUFFIX="›%{$reset_color%}" +# on dumb terminals, switch to simpler prompt char +# (for Emacs and tramp) +if [[ $TERM = 'dumb' ]]; then + user_prompt_char='$' + # change prefix as not to confuse tramp and emacs-shell + ZSH_THEME_GIT_PROMPT_PREFIX="[" + ZSH_THEME_GIT_PROMPT_SUFFIX="]" + PROMPT='$ ' + PS1='$ ' + unsetopt zle +# unsetopt prompt_cr +fi