Start oh-my-posh from a file in $HOME/.bashrc.d/... #7239
Replies: 1 comment 1 reply
-
|
Sorry for the noise, I tried around with it, and suddenly it worked... I can't even tell what I changed, but it suddenly worked... Sorry again. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have the habit to move all additions to .bashrc into a subfolder (home/.bashrc.d) as individual scripts, and source the files there from .bashrc. It helps me keep a tidy bashrc, enable/disable components easily, and move them between systems. I think this is quite common practice. For oh-my-posh this doesn't work in the standard configuration. Instead of the beautiful prompt, I just get two lines in my terminal prompt, showing (I guess) what should have succeeded, and didn't:
When at that point I grep for POSH in my env, I see no trace of it, while I see three entries if I start oh-my-posh the expected way. I guess some export did not land in my parent shell.
I have read the requirement to start oh-my-posh as the last entry in .bashrc, and it works beautifully if I do so... However, is there maybe a start-option to make my default setup work, i.e. put the
eval $(oh-my-posh init bash)line in a file in.bashrc.d/that is sourced from the actual .bashrc? Thank you for any help!Beta Was this translation helpful? Give feedback.
All reactions