Created
May 8, 2019 19:03
-
-
Save prateekbh/42408789a0c82316defc7f950a59d9d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function title { | |
export TITLE_OVERRIDDEN=1 | |
PROMPT_COMMAND='' | |
echo -ne "\033]0;"$*"\007" | |
} | |
case "$TERM" in | |
xterm*|rxvt*) | |
PROMPT_COMMAND='echo -ne "\033]0;${PWD##*/}\007"' | |
show_command_in_title_bar() | |
{ | |
if [[ "$TITLE_OVERRIDDEN" == 1 ]]; then return; fi | |
case "$BASH_COMMAND" in | |
*\033]0*) | |
;; | |
*) | |
echo -ne "\033]0;${BASH_COMMAND} - ${PWD##*/}\007" | |
;; | |
esac | |
} | |
trap show_command_in_title_bar DEBUG | |
;; | |
*) | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment