I recently added these lines to my ~ / .bashrc file to show the current branch if I'm in the git working folder and it works great for this. However, I lost the fact that the current folder name that was shown on the tab for terminal i is open, and now it is not: it always just says "Terminal". Can I get this back and still save the git stuff? Here the lines in question are the second problem, that is the problem, since commenting only on the second line fixes the problem.
source /etc/bash_completion.d/git PS1='\h:\w$(__git_ps1 "\[\e[32m\][%s]\[\e[0m\]")$ '
I was looking for an explanation of the options for PS1, but I see nothing about the name of the terminal window. Can anyone advise? thanks max
EDIT
I actually manipulate PS1 in order to have a terminal with the format
<rvm version and gemset> <computer name> <current folder> <git branch>
with each part of a different color, but I have never seen documents before, so thanks for the link to this. My current PS1 setup
\[\033[0;31m\]$(__my_rvm_ruby_version)\[\033[0;33m\]\h\[\033[0;37m\]:\[\033[1;33m\]\W\[\033[1;32m\]$(__git_branch)\[\033[1;32m\]$(__git_dirty) \[\033[0;37m\]$
Presumably I can do something like
export "<something> $PS1"
to set the name of my terminal tab without losing my existing settings. I did all this, but failed to do it.
EDIT - figured this out with some of the answers below - thanks everyone! I wrapped it in a shell script
#!/usr/bin/env bash
it is called "renametab", so now I can name it, for example,
source renametab mytabname
a "source" is needed to export changes to the current shell: if I just do renametab mytabname , the export just goes into a subshell, which gets killed when the script ends.
Thanks again for your help!