Till now the tab titles in terminal are just a repetition of the prompt.
The aim of this bug is to provide tab titles in the form "(last segment of the path): (last executed cmd)"
While executing a process like e.g. top the cmd name is printed in the form "cmd" in the title.
To achive this afaik the only way for bash is to do it with a trap DEBUG.
To not hijack the debug trap from the user the linked branch uses this script: https://github.com/rcaloras/bash-preexec
It adds preexec and precmd to bash just like in Zsh. So the user can hook as much own function as he wants.
It doesn't override already set PROMPT_COMMAND so the actual notification hook still persists.
The scripts must be source at the end of the bashrc:
if [ -f ~/.bash_preexec ]; then
# preexec and precmd hook functions for Bash
# If you have anything that's using the Debug Trap, change it to use
# preexec. See also https://github.com/rcaloras/bash-preexec
. ~/.bash_preexec
# set bash titles for elementary OS
. ~/.bash_titles
fi
this must be comment out in the now shipped bashrc in order to get the bash_titles to work:
# keep commented out when using .bash_titles
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
# PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
# ;;
#*)
# ;;
#esac
Till now the tab titles in terminal are just a repetition of the prompt.
The aim of this bug is to provide tab titles in the form "(last segment of the path): (last executed cmd)"
While executing a process like e.g. top the cmd name is printed in the form "cmd" in the title.
To achive this afaik the only way for bash is to do it with a trap DEBUG. /github. com/rcaloras/ bash-preexec
To not hijack the debug trap from the user the linked branch uses this script:
https:/
It adds preexec and precmd to bash just like in Zsh. So the user can hook as much own function as he wants.
It doesn't override already set PROMPT_COMMAND so the actual notification hook still persists.
The scripts must be source at the end of the bashrc: /github. com/rcaloras/ bash-preexec
if [ -f ~/.bash_preexec ]; then
# preexec and precmd hook functions for Bash
# If you have anything that's using the Debug Trap, change it to use
# preexec. See also https:/
. ~/.bash_preexec
# set bash titles for elementary OS
. ~/.bash_titles
fi
this must be comment out in the now shipped bashrc in order to get the bash_titles to work:
# keep commented out when using .bash_titles \e]0;${ debian_ chroot: +($debian_ chroot) }\u@\h: \w\a\]$PS1"
# If this is an xterm set the title to user@host:dir
#case "$TERM" in
#xterm*|rxvt*)
# PS1="\[
# ;;
#*)
# ;;
#esac