Sample Header Ad - 728x90

Colored bash prompt and tab title

0 votes
0 answers
460 views
I cannot seem to get both a colored terminal prompt and the tab title to change at the same time. function tab_title() { local tab_replace="${USER}@${HOSTNAME}" local tab_orig="$PS1" local tab_new="\e]2;${tab_replace}\a" echo "${tab_orig}${tab_new}" } function colour_prompt() { local c_off="\[\033[0m\]" # Colour off local c_red="\[\033[1;31m\]" # Colour red echo "${debian_chroot:+($debian_chroot)}${c_red}\u@\h${c_off}/" } PS1="${tab_title}${color_prompt}" I never managed to get the alternative tab title working echo -en "\033]0;New terminal title\a" What am I doing wrong? Also, what are the $debian_chroot variables for?
Asked by myol (313 rep)
Jul 24, 2019, 07:40 PM
Last activity: Jul 24, 2019, 08:05 PM