Browse Source

Simplify logic in show_command_in_title_bar()

Re-use the case switch
Alois Mahdal 10 years ago
parent
commit
f3102e5cef
1 changed files with 4 additions and 6 deletions
  1. 4
    6
      dotfiles/bash/post.bashrc

+ 4
- 6
dotfiles/bash/post.bashrc View File

@@ -70,13 +70,11 @@ case "$TERM" in
70 70
                     # In any case nested escapes confuse the terminal, so don't
71 71
                     # output them.
72 72
                     ;;
73
+                "")
74
+                    echo -ne "\033]0;$(__make_ps1d)$__host_id${PWD/$HOME/~}\$\007"
75
+                    ;;
73 76
                 *)
74
-                    if test -n "${BASH_COMMAND}";
75
-                    then
76
-                        echo -ne "\033]0;${BASH_COMMAND} ($__host_id${PWD/$HOME/~})\007"
77
-                    else
78
-                        echo -ne "\033]0;$(__make_ps1d)$__host_id${PWD/$HOME/~}\$\007"
79
-                    fi
77
+                    echo -ne "\033]0;${BASH_COMMAND} ($__host_id${PWD/$HOME/~})\007"
80 78
                     ;;
81 79
             esac
82 80
         }