Closed yggdr closed 8 months ago
PR with fix is welcome!
After looking into how xontribs work and investigating the underlying issue, I can give you two possible solutions:
The short fix https://github.com/anki-code/xontrib-prompt-starship/pull/14 which only introduces a Path(...).expanduser()
at one point, and the slightly longer fix https://github.com/anki-code/xontrib-prompt-starship/pull/15 which does some minor refactoring, moving the expanduser responsibility completely outside the _starship_prompt
function.
I would prefer the longer version.
Hey @yggdr! Thank you for two options. I asked question in #15 .
I don't see a question in either PR.
Strange, I still do not see anything in the PR itself?! But to answer your question: that was a mistake when rearranging some code, apparently I didn't test thoroughly again afterwards. I corrected it to STARSHIP_CONFIG
. That way, left-cfg falls back to it if no side-specific prompt is set.
Using the first example of creating a short toml, setting
$STARSHIP_CONFIG
to a string like~/.config/stuff.toml
or$HOME/.config/other_stuff.toml
does not pick up those configuration files. After experimenting withstarship config
a bit it seems that the value of$STARSHIP_CONFIG
isn't actually taken to be an absolut path (with~
or$HOME
properly expanded), but instead an unexpanded path relative to the current directory. Sostarship config
would try to open the non-existing file/current/working/directory/~/.config/stuff.toml
.