Score:0

Terminal window title vs Git branch name in the command prompt?

cx flag

I wanted to add information about Git branch to my command line prompt, and I found this post:

parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}

export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "

I added those lines into my .bashrc.

However, this messes up my terminal's window title, which used to contain current working directory, and now it just says "Terminal."

Why did this change the terminal window title? Is there a better solution?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.