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?
colour_prompt
? – ilkkachu Jul 24 '19 at 19:51