Git repository paths in segment don't match when using a symlink #6696
phealy
started this conversation in
Show and tell
Replies: 0 comments
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.
-
Good day! I was trying to do something like this and ran into an issue: if I'm cd'd into my git repo via a symlink, then
.Segments.Git.Dirand.Segments.Git.RelativeDirdon't take the symlink into account, but the path segment does.My folder template:
Reproduction:
$ mkdir -p deep/path/to/repo $ ln -s deep/path/to/repo $ cd repo $ git initAfter doing that,

.RelativeDirwill be../../../../../repo, so the prompt segment ends up looking like this:This is made more difficult by the fact that I can't find a preexisting way to get the relative physical path in oh-my-posh - .AbsolutePWD the physical path, but it's not relative to my home directory, whereas all of the ones that are relative have the symlink and not the full path. Only the git segment functions seem to have that combination.
I've tried a number of workarounds and came up with this that works, but it seems like there should be a much simpler way:
Thanks! Really enjoying oh-my-posh so far.
Beta Was this translation helpful? Give feedback.
All reactions