Using bash backslash-escaped prompt characters #2267
|
I am a long time bash user in Linux that finally has decided to try out the new prompt styling tools. Oh My Posh is really nice and very fast! I do miss some things from vanilla bash, though. Especially having the history number and the terminal number in the prompt. With bash, I can achieve this by the backslash-escaped prompt characters '!' and '\l': Result: I thought I could use a text segment to achieve the same result: However, I get an extra backslash in front of each number: I figure this is because the template is taken literally instead of the first backslash being interpreted as an escape character. If I change the double backslashes to singles, oh-my-posh fails to parse the theme file: Does anyone know of a way to get around this? |
Replies: 1 comment 4 replies
|
Yes, that's because we replace |

Yes, that's because we replace
\!with\\!to avoid this from happening (so I'm confused as to why it now does display that). We could agree not to do that for the text segment, and still have this flexibility.