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