From: Simon Ruderich Date: Sat, 27 Apr 2013 14:14:35 +0000 (+0200) Subject: zsh/rc: Remove unnecessary variable zshrc_window_root. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=c464b056d6900011fcb2a22c7bb8cf130b21b238;p=config%2Fdotfiles.git zsh/rc: Remove unnecessary variable zshrc_window_root. --- diff --git a/zsh/rc b/zsh/rc index dea4804..7a7dbae 100644 --- a/zsh/rc +++ b/zsh/rc @@ -444,10 +444,6 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then # Is set to a non empty value to reset the window name in the next # precmd() call. zshrc_window_reset=yes - # Is set to a non empty value when the shell is running as root. - if [[ $UID -eq 0 ]]; then - zshrc_window_root=yes - fi zshrc_window_preexec() { # Get the program name with its arguments. @@ -492,7 +488,7 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then # Add an exclamation mark at the beginning if running with sudo or if # running zsh as root. - if [[ -n $program_sudo || -n $zshrc_window_root ]]; then + if [[ -n $program_sudo || $UID -eq 0 ]]; then program_name=!$program_name fi @@ -531,7 +527,7 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then fi # Prepend prefixes like in window_preexec(). - if [[ -n $zshrc_window_root ]]; then + if [[ $UID -eq 0 ]]; then name="!$name" fi if [[ -n $SSH_CONNECTION ]]; then