From: Simon Ruderich Date: Sun, 15 Feb 2009 14:35:45 +0000 (+0100) Subject: Display a ! in screen's window name for sudo programs. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=cdc49c3e88de959b760dab5076df2253d503610e;p=config%2Fdotfiles.git Display a ! in screen's window name for sudo programs. --- diff --git a/zsh/rc b/zsh/rc index 070e3c1..c04bf21 100644 --- a/zsh/rc +++ b/zsh/rc @@ -136,9 +136,10 @@ if [[ $TERM == screen ]]; then screen_preexec() { # Get the program name with its arguments. local program_name=$1 - # When sudo is used use real program name instead. + # When sudo is used use real program name instead, but with an + # exclamation mark at the beginning. if [[ $program_name == sudo* ]]; then - program_name=${program_name#sudo } + program_name=!${program_name#sudo } fi # Remove all arguments from the program name. program_name=${program_name%% *}