Bash PS1 settings - how to get the current folder back as the terminal title

Posted by Max Williams on Stack Overflow See other posts from Stack Overflow or by Max Williams
Published on 2010-03-09T16:49:34Z Indexed on 2010/03/11 19:49 UTC
Read the original article Hit count: 280

Filed under:
|
|
|

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

© Stack Overflow or respective owner

Related posts about .bashrc

Related posts about git