Skip to content

Questions on how the path segment's mapped_locations feature works. #690

Answered by lnu
osterhoutan asked this question in Troubleshoot
Discussion options

You must be logged in to vote

Right now, the replaceMappedLocations function checks if the current location starts with one of the prefix defined in mapped_locations and replaces it with a custom glyph/text.

Example:
"mapped_locations": [
["D:\dev", "\uf962"],
],

will replace d:\dev\ohmyposh to \uf962\ohmyposh

but you can't do something like this:
"mapped_locations": [
["dev", "\uf962"],
],

and expects that it will replace the text dev anywhere in the path.

I don't remember exactly why it wasn't done as we obviously discussed it in the issue related to ignore_folders.

func (pt *path) replaceMappedLocations(pwd string) string {

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by JanDeDobbeleer
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #688 on April 27, 2021 16:57.