# HG changeset patch # User Augie Fackler # Date 1263400452 21600 # Node ID ebbbf3567a0e1981c7812b1349253f32f202f7c3 # Parent da329720ff189d2c2227b6a6a65e03a4fe5afe8c zsh prompt: detabify diff --git a/.shell.d/99.prompt.zsh b/.shell.d/99.prompt.zsh --- a/.shell.d/99.prompt.zsh +++ b/.shell.d/99.prompt.zsh @@ -6,16 +6,16 @@ setopt prompt_subst preexec () { - currJob="`echo $3 | cut -d ' ' -f 1 | head -n 1`" - if [[ "$TERM" == "screen" ]]; then - hostUser="%10<...<%~%<<" - print -Pn "\ek[$hostUser $currJob]\e\\" - else - if [[ "$FANCYTYPE" == "YES" ]]; then - hostUser="%n@%m: %2~" - print -Pn "\e]0;$hostUser [$currJob]\a" - fi - fi + currJob="`echo $3 | cut -d ' ' -f 1 | head -n 1`" + if [[ "$TERM" == "screen" ]]; then + hostUser="%10<...<%~%<<" + print -Pn "\ek[$hostUser $currJob]\e\\" + else + if [[ "$FANCYTYPE" == "YES" ]]; then + hostUser="%n@%m: %2~" + print -Pn "\e]0;$hostUser [$currJob]\a" + fi + fi } function right_side_prompt() { @@ -32,16 +32,16 @@ function precmd () { } if [ "x`whoami`" = "xroot" ] ; then - PS1=$'%{\e];%n@%m: %2~ [zsh]\a%}[%m:%3~] %{\e[31m%}%n%{\e[0m%}%# ' - if [[ "$TERM" == "screen" ]] ; then - PS1=$'%{\ek[%2~ zsh]\e\\%}[%m:%3~] %{\e[31m%}%n%{\e[0m%}%# ' - fi - RPS1=$'%{\e[1;35m%}[DANGER %t]%{\e[0m%}%(?..%{\e[1;33m%} %?%{\e[1;0m%})' + PS1=$'%{\e];%n@%m: %2~ [zsh]\a%}[%m:%3~] %{\e[31m%}%n%{\e[0m%}%# ' + if [[ "$TERM" == "screen" ]] ; then + PS1=$'%{\ek[%2~ zsh]\e\\%}[%m:%3~] %{\e[31m%}%n%{\e[0m%}%# ' + fi + RPS1=$'%{\e[1;35m%}[DANGER %t]%{\e[0m%}%(?..%{\e[1;33m%} %?%{\e[1;0m%})' else - PS1=$'%{\e];%n@%m: %2~ [zsh]\a%}[%m:%3~] %{\e[34m%}%n%{\e[0m%}%# ' - if [[ "$TERM" == "screen" ]]; then - PS1=$'%{\ek[%2~ zsh]\e\\%}[%m:%3~] %{\e[34m%}%n%{\e[0m%}%# ' - fi + PS1=$'%{\e];%n@%m: %2~ [zsh]\a%}[%m:%3~] %{\e[34m%}%n%{\e[0m%}%# ' + if [[ "$TERM" == "screen" ]]; then + PS1=$'%{\ek[%2~ zsh]\e\\%}[%m:%3~] %{\e[34m%}%n%{\e[0m%}%# ' + fi RPS1=$'[$rps_branch]%(?..%{\e[1;33m%} %?%{\e[0m%})' fi