Travis Swicegood | 4c3f21a | 2012-04-30 11:09:46 -0500 | [diff] [blame] | 1 | # This plugin is known to cause issues on OS X with the evaluation of |
| 2 | # colors. Please read [issue 108] for more information. |
| 3 | # |
| 4 | # You can manually turn this on by symlinking it into your |
| 5 | # plugins/enabled/ directory. |
| 6 | # |
| 7 | # [issue 108]: https://github.com/revans/bash-it/issues/108 |
| 8 | |
Erich Smith | 3f8fe61 | 2012-05-09 09:27:10 -0400 | [diff] [blame] | 9 | cite about-plugin |
| 10 | about-plugin 'automatically set your xterm title with host and location info' |
| 11 | |
Antono Vasiljev | 538980c | 2011-12-17 11:46:40 +0300 | [diff] [blame] | 12 | set_xterm_title () { |
| 13 | local title="$1" |
| 14 | echo -ne "\e]0;$title\007" |
| 15 | } |
| 16 | |
Antono Vasiljev | f3c6300 | 2012-03-04 22:58:53 +0300 | [diff] [blame] | 17 | |
Antono Vasiljev | 538980c | 2011-12-17 11:46:40 +0300 | [diff] [blame] | 18 | precmd () { |
| 19 | set_xterm_title "${USER}@${HOSTNAME} `dirs -0` $PROMPTCHAR" |
| 20 | } |
| 21 | |
| 22 | preexec () { |
| 23 | set_xterm_title "$1 {`dirs -0`} (${USER}@${HOSTNAME})" |
| 24 | } |
| 25 | |
Antono Vasiljev | f3c6300 | 2012-03-04 22:58:53 +0300 | [diff] [blame] | 26 | case "$TERM" in |
| 27 | xterm*|rxvt*) preexec_install;; |
| 28 | esac |