Bash PS1 settings - how to get the current folder back as the terminal title
- by Max Williams
Hi all. I recently added these lines to my ~/.bashrc file to show the current branch if i'm in a git working folder, and it works nicely for that. However, what i've lost is that the current folder name used to be shown in the tab for the terminal i have open, and now it isn't: it always just says 'Terminal'. Can i get that back and still keep the git stuff? Here's the lines in question - it's the second one that's the issue, as commenting out just the second line fixes the problem.
source /etc/bash_completion.d/git
PS1='\h:\w$(__git_ps1 "\[\e[32m\][%s]\[\e[0m\]")$ '
I've been looking at explanations of the options for PS1 but can't see anything about the terminal window's title in there. Can anyone advise? thanks, max