Closed SCdF closed 11 years ago
(Note that is appears to work the first time since you call source on bashrc, but it won't get run on the creation of a new term)
Yikes! That's what I get for testing on a non-fresh machine. Alright, I will look into this. Thanks!
I have read up on this and it seems that the . ~/.bashrc
should be handled on an OS by OS basis. However, on Ubuntu, the prompt isn't picked up in .bash_profile
, .bash_login
, or .profile
.
I have chosen to avoid the complexity of detecting if .bash_profile
has .bashrc
being invoked inside of it. It opens possibilities for more edge cases and expands outside of the one-thing-well paradigm.
Instead, I have added a FAQ section with a question about "The prompt is not present in new shells" in 0.10.7
.
I came up with a better solution when I woke up today:
$PS1
.bash_profile
, add `. ~/.bashrc
to it.bash_login
, add `. ~/.bashrc
to it.profile
, add `. ~/.bashrc
to it`. ~/.bashrc
to ~/.bash_profile
One annoying part will be testing this. I would also consider releasing that in a separate project, just not sure how re-usable it will be.
Wrote out gist of this today. Unfortunately, I am bumping heads with Travis CI on getting the test working with bash -i
and going to sleep out of frustration/tiredness
https://github.com/twolfson/sexy-bash-prompt/compare/dev;graceful.install?expand=1
Tested on OSX and looks good. Unfortunately, the trigger inside of install.sh
does not expand to the parent shell (TODO).
Gave up on Travis CI testing of installation. Released install script which handles .bashrc
not being invoked in 0.11.0
.
MacOSX doesn't use ~/.bashrc. Instead it uses the first file it finds out of a specific list, shown here: http://apple.stackexchange.com/questions/12993/why-doesnt-bashrc-run-automatically#comment13715_13019
To make your script work locally on MacOSX I took the hook you added in bashrc and added it to .bash_profile instead. It sounds though, like you might need to make sure you put it in the right one (since the creation of .bash_profile would stomp on .profile)