-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call from .bashrc instead of .bash_profile? #43
Comments
True, and I have been using git-aware-prompt for a while without noticing the problem because I was always ssh'ing to a Linux VM, so every shell was a login shell. |
While it is a good idea to source .bashrc from .bash_profile, or link one to the other, I doubt that everyone who uses git-aware-prompt has done that, given previously-reported issues. Switching the order in the readme is bound to lead to more confusion and issues like "Change .bashrc to .bash_profile?". I think the best solution is to mention that different environments may read from different files when starting a shell, so people either need to figure out which one to add git-aware-prompt to or ensure that it is set up regardless of which file is loaded (e.g. sourcing one file from the other, linking one file to the other, etc.). |
What you propose is a good compromise. |
On a fresh installation of Ubuntu 16.04, ~/.bash_profile does not exist, but ~/.profile does (and sources .bashrc when run by bash):
Neither of these exist on OS X, however, and it probably varies on other Linux distros. I'll look at updating the readme if I get a chance, although this project hasn't been especially active lately, so I don't know when it'll get merged. |
I believe the owner is more likely to merge documentation than code. This popular answer recommends that Perhaps the installation instructions should recommend using CentOS has no (By the way, we could even detect an interactive shell like this.) |
The instructions say to install in .bash_profile. If you do this, then find_git_branch and find_git_dirty functions aren't defined in any bash/xterm started from a login shell, so git_branch and git_dirty variables don't get updated.
I think the instructions should be changed to recommend installation in .bashrc instead
The text was updated successfully, but these errors were encountered: