Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why italics used in prompt, what does it signify? #2321

Closed
mmmatjaz opened this issue May 28, 2020 · 3 comments
Closed

Why italics used in prompt, what does it signify? #2321

mmmatjaz opened this issue May 28, 2020 · 3 comments
Labels
👆 clink Upstream issue in clink. 👆 Git Upstream issue in Git for Windows. ❔ Type: Question

Comments

@mmmatjaz
Copy link

This is not really an issue, just a question:
Sometimes, when I'm in a folder that is a git repository, the branch label becomes italic, e.g.:
(master -> origin)
What does that mean?

@daxgames
Copy link
Member

My Cmder git status prompt has never been in italics so I can't answer the question.

@stale stale bot added the 👀 Awaiting Response Waiting to hear back from the issue reporter. label Jul 2, 2020
@stale stale bot closed this as completed Jul 11, 2020
@noopole
Copy link

noopole commented Jan 4, 2024

I just had the same behaviour.
Example (with a console split):
image

@cmderdev cmderdev deleted a comment from stale bot Apr 26, 2024
@cmderdev cmderdev deleted a comment from stale bot Apr 26, 2024
@DRSDavidSoft DRSDavidSoft added 👆 clink Upstream issue in clink. ❔ Type: Question and removed 👀 Awaiting Response Waiting to hear back from the issue reporter. labels Apr 26, 2024
@DRSDavidSoft DRSDavidSoft reopened this Apr 26, 2024
@DRSDavidSoft
Copy link
Contributor

Hi, sorry for the late response.

After digging into the FaqBoldItalic and AnsiEscapeCodes pages per ConEmu documentation to make sure that the ESC [ 3 m sequence is used to make the text Italic I looked into the code that is used to display the prompt.

@noopole Your screenshot helped me understand that the git prompt part of the Clink shell must be outputting this italic sequnce somewhere, so I opened the clink.lua code to investigate, sure enough the get_dirty_color() function has this sequence, it even has a comment!

return dirty_color or "\x1b[33;3m" -- Yellow, Italic

In other words, this style is used to indicate dirty repositories. Running git status will give more information about the repository state, and here is the documentation in git that describes the "dirty" state.

Under the hood, Cmder uses the following command to detect the "dirty" state:

git --no-optional-locks status --porcelain

Also, note that you can customize the "yellow" color and the "italics" style by editing the cmder_prompt_config.lua config file.

Now here's the part that is bugging my mind, in the screenshot that is shared, it appeared that the "italics" style continues to the next line, and even passes the λ symbol.

This should be impossible in the Cmder builds after the #2772, which is a PR I specifically made to fix the "bleeding" issue back in 2022, yet your screenshot appears to be recent.

Please ensure that you are using the latest version of Cmder, in which case, the italic style is used by design to indicate the "dirty" repositories, yet it must only be applied to the git repo part, not everything that comes after it.

Conclusion

  • If you are only curious about why this happens, the reason is to indicate the "dirty" repo state.

  • If you want to alter it or disable it, edit the cmder_prompt_config.lua file and use your own custom style.

  • If everything after the git prompt also becomes Italic, please update the Cmder to the latest version, and if it persists, please open an issue so I can investigate.

@DRSDavidSoft DRSDavidSoft changed the title Why italics Why italics used in prompt, what does it signify? Apr 26, 2024
@DRSDavidSoft DRSDavidSoft added the 👆 Git Upstream issue in Git for Windows. label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👆 clink Upstream issue in clink. 👆 Git Upstream issue in Git for Windows. ❔ Type: Question
Projects
None yet
Development

No branches or pull requests

4 participants