From 197eac5617877b22737f297a4c5143a3e14a65e0 Mon Sep 17 00:00:00 2001 From: Nils Pascal Illenseer Date: Sun, 21 Aug 2011 11:41:22 +0200 Subject: [PATCH] Add a simple prompt for dumb terminals, which fixes problems with Emacs or Vim. --- themes/illenseer.zsh-theme | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/themes/illenseer.zsh-theme b/themes/illenseer.zsh-theme index 1bb792cf9..b5534e10d 100644 --- a/themes/illenseer.zsh-theme +++ b/themes/illenseer.zsh-theme @@ -3,7 +3,7 @@ # DESCRIPTION: oh-my-zsh theme file, based on themes by Juan G. Hurtado, # Stephen Tudor, Dejan Ranisavljevic, jnrowe # AUTHOR: Nils Pascal Illenseer -# VERSION: 1 +# VERSION: 2 # SCREENSHOT: http://www.flickr.com/photos/infion/5902602288/lightbox # ------------------------------------------------------------------------ @@ -36,8 +36,10 @@ local ret_status="%(?:%{$fg_bold[green]%}✔:%{$fg_bold[red]%}✘ %s%?)" # root (red) vs. normal user (green) if [[ `id -u` -eq 0 ]]; then user="%{$fg_bold[red]%}%n" + end="#" else user="%{$fg_bold[green]%}%n" + end="$" fi # local (white) vs. remote (yellow) @@ -48,6 +50,10 @@ else fi # Prompt format +if [[ "$TERM" != "dumb" ]] && [[ "$DISABLE_LS_COLORS" != "true" ]]; then PROMPT='${ret_status} ${user}%{$fg_bold[white]%}@${loc} %{$fg_bold[blue]%}%~%u %{$fg_bold[white]%}❱%{$reset_color%} ' RPROMPT='$(git_prompt_ahead)%{$fg_bold[white]%}$(git_prompt_info)$(git_prompt_short_sha)$(git_prompt_status)%{$reset_color%}' +else +PROMPT='%n@%m: %~%u ${end} ' +fi