1

I am using the following .bashrc file. The tab completion works fine. However. The second piece of code the #show branch is not being so nice. When I first set it up and sourced it it worked fine. My terminal window it was is at the home location would look something like this [~]$ and when its in a branch something like [direcorty (master)]$ However when I opened a new tab window of terminal it goes back to something like Anders-imac:~ anderskitson$ How do I get the Show branch in status line to stay.

#Git tab completion source ~/git-completion.bash # Show branch in status line PS1='[\W$(__git_ps1 " (%s)")]\$ ' export PROMPT_COMMAND='echo -ne "\033]0;${PWD/#$HOME/~}\007"' 

2 Answers 2

1

The reason it's not staying is likely because your terminal is using .bash_profile rather than your .bashrc.

I would create a link to your .bashrc file so that all new terminal windows will use that code from a single .bashrc file:

mv ~/.bash_profile ~/.bash_profile.bak ln -s ~/.bashrc ~/.bash_profile 

mv = move, this will backup your current .bash_profile in case you have something important in there you want to keep. ln -s = create a symbolic link from .bashrc to .bash_profile.

Sign up to request clarification or add additional context in comments.

Comments

0

Maybe your shells are login shells? If they are, .bashrc doesn't necessarily get read. Try making a similar change in your .bash_profile, or simply source .bashrc from your .bash_profile.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.