From: Antono Vasiljev Date: Sat, 17 Dec 2011 08:46:40 +0000 (+0300) Subject: Set terminal emulatior title X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=538980c449ca0c1b5e5d58f24ae5046a238659da;p=common%2Fbash_it.git Set terminal emulatior title --- diff --git a/plugins/available/xterm.plugins.bash b/plugins/available/xterm.plugins.bash new file mode 100644 index 0000000..94d4c33 --- /dev/null +++ b/plugins/available/xterm.plugins.bash @@ -0,0 +1,14 @@ +set_xterm_title () { + local title="$1" + echo -ne "\e]0;$title\007" +} + +precmd () { + set_xterm_title "${USER}@${HOSTNAME} `dirs -0` $PROMPTCHAR" +} + +preexec () { + set_xterm_title "$1 {`dirs -0`} (${USER}@${HOSTNAME})" +} + +preexec_install