|
@@ -53,32 +53,34 @@ export PS2=$(make_ps2)
|
53
|
53
|
### '''''' ###
|
54
|
54
|
|
55
|
55
|
case "$TERM" in
|
56
|
|
-xterm*|rxvt*|screen*)
|
57
|
|
- test -n "$SSH_CONNECTION" \
|
58
|
|
- && __host_id="${HOSTNAME%%.*}:" # i.e. a remote session
|
59
|
|
- PROMPT_COMMAND='__save_rv $?; echo -ne "\033]0;$(__make_ps1d)$__host_id${PWD/$HOME/~}\$\007"'
|
60
|
56
|
|
61
|
|
- # Show the currently running command in the terminal title:
|
62
|
|
- # http://www.davidpashley.com/articles/xterm-titles-with-bash.html
|
63
|
|
- show_command_in_title_bar()
|
64
|
|
- {
|
65
|
|
- case "$BASH_COMMAND" in
|
66
|
|
- *\033]0*)
|
67
|
|
- # The command is trying to set the title bar as well;
|
68
|
|
- # this is most likely the execution of $PROMPT_COMMAND.
|
69
|
|
- # In any case nested escapes confuse the terminal, so don't
|
70
|
|
- # output them.
|
71
|
|
- ;;
|
72
|
|
- *)
|
73
|
|
- if test -n "${BASH_COMMAND}";
|
74
|
|
- then
|
75
|
|
- echo -ne "\033]0;${BASH_COMMAND} ($__host_id${PWD/$HOME/~})\007"
|
76
|
|
- else
|
77
|
|
- echo -ne "\033]0;$(__make_ps1d)$__host_id${PWD/$HOME/~}\$\007"
|
78
|
|
- fi
|
79
|
|
- ;;
|
80
|
|
- esac
|
81
|
|
- }
|
82
|
|
- trap show_command_in_title_bar DEBUG
|
83
|
|
- ;;
|
|
57
|
+ xterm*|rxvt*|screen*)
|
|
58
|
+ test -n "$SSH_CONNECTION" \
|
|
59
|
+ && __host_id="${HOSTNAME%%.*}:" # i.e. a remote session
|
|
60
|
+ PROMPT_COMMAND='__save_rv $?; echo -ne "\033]0;$(__make_ps1d)$__host_id${PWD/$HOME/~}\$\007"'
|
|
61
|
+
|
|
62
|
+ # Show the currently running command in the terminal title:
|
|
63
|
+ # http://www.davidpashley.com/articles/xterm-titles-with-bash.html
|
|
64
|
+ show_command_in_title_bar()
|
|
65
|
+ {
|
|
66
|
+ case "$BASH_COMMAND" in
|
|
67
|
+ *\033]0*)
|
|
68
|
+ # The command is trying to set the title bar as well;
|
|
69
|
+ # this is most likely the execution of $PROMPT_COMMAND.
|
|
70
|
+ # In any case nested escapes confuse the terminal, so don't
|
|
71
|
+ # output them.
|
|
72
|
+ ;;
|
|
73
|
+ *)
|
|
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
|
|
80
|
+ ;;
|
|
81
|
+ esac
|
|
82
|
+ }
|
|
83
|
+ trap show_command_in_title_bar DEBUG
|
|
84
|
+ ;;
|
|
85
|
+
|
84
|
86
|
esac
|