]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
Display a ! in screen's window name for sudo programs.
authorSimon Ruderich <simon@ruderich.org>
Sun, 15 Feb 2009 14:35:45 +0000 (15:35 +0100)
committerSimon Ruderich <simon@ruderich.org>
Mon, 16 Feb 2009 15:34:43 +0000 (16:34 +0100)
zsh/rc

diff --git a/zsh/rc b/zsh/rc
index 070e3c10800b8c49a922688e733b6b0554124a9e..c04bf215a7b00747fe5d286afd64f83e94cfd98a 100644 (file)
--- 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%% *}