JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
16.79k stars 2.35k forks source link

Ability to add git status to the console title / cleanse environment variables #1922

Closed piersmyers closed 2 years ago

piersmyers commented 2 years ago

Code of Conduct

What would you like to see changed/added?

Please add the ability to include the git status to the console title. I still use Posh Git in my Windows 10 powershell 7 terminal and it does set the POSH_GIT_STATUS environment variable that I could use but OMP doesn't like it to be added to my console_title_template, e.g.:

"console_title_template": "{{ if .Root }}(Admin) {{ end }}{{ .Folder }}{{ .Env.POSH_GIT_STATUS }}"

I assume it is because it is full of escape characters to colourise it. Could it be possible to cleanse this variable so that it can be added to the console title?

JanDeDobbeleer commented 2 years ago

@piersmyers confirmed to be ANSI. Will tackle that.

JanDeDobbeleer commented 2 years ago

@piersmyers

image

piersmyers commented 2 years ago

Awesome, thank you so much for doing this so quickly Jan, works perfectly now. You're a ⭐.

github-actions[bot] commented 7 months ago

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.