Created
December 9, 2013 22:44
-
-
Save sgrankin/7882407 to your computer and use it in GitHub Desktop.
Show current command; current directory in terminal title. Source: http://unix.stackexchange.com/questions/91555/how-do-i-make-the-xterm-window-title-switch-between-the-current-running-command Includes semicolon fixup for PROMPT_COMMAND:
bugs: tmux shows 'show_name'; possibly conflicting with something...
This file contains hidden or 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
trap 'echo -ne "\033]0;${BASH_COMMAND%% *}\007"' DEBUG | |
function show_name { | |
if [[ -n "$BASH_COMMAND" ]]; then | |
echo -en "\033]0;`basename ${PWD}`\007" | |
fi | |
} | |
export PROMPT_COMMAND=${PROMPT_COMMAND:+${PROMPT_COMMAND%%;*( )};}'history -a;show_name' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment