From cdc49c3e88de959b760dab5076df2253d503610e Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 15 Feb 2009 15:35:45 +0100 Subject: [PATCH] Display a ! in screen's window name for sudo programs. --- zsh/rc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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%% *} -- 2.45.2