oh-my-posh: Incompatible ANSI escape sequence at the end
Prerequisites
- I have read and understand the
CONTRIBUTINGguide - I looked for duplicate issues before submitting this one
Description
While tinkering around with Clink, the author (@chrisant996) of the revived project discovered a bug in the default theme of OMP3. This does not cause any functional issues, but renders the theme incompatible with Readline libraries on many platforms.
The details of the discovery are mentioned here chrisant996/clink#39, while explanations and reproduction steps are mentioned in chrisant996/clink#40.
Environment
- Oh my Posh version: 3.61.1
- Theme: Default
- Operating System: any
- Shell: any
- Terminal: any
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (17 by maintainers)
Commits related to this issue
- fix: only clear eol on Powershell related to #277 — committed to JanDeDobbeleer/oh-my-posh by JanDeDobbeleer 4 years ago
- fix: only clear eol on Powershell related to #277 — committed to JanDeDobbeleer/oh-my-posh by JanDeDobbeleer 4 years ago
Yes, no error bell now!
Thanks!
"console_title": falseìn the general settings of the json config file.Stopwatch says it’s around 1 second. I guess it feels like 3 seconds because Lua scripts in Clink can do the same work (including git enhancements) in around 1/4 second, but that’s to be expected since they don’t have to load a large binary or initialize internal runtime frameworks, etc.
Cool, sounds great.
It sounds like all of the issues are well understood, so at this point I think there’s no need for me to collect/upload additional information.
Ok, so, I just reread the entire thread in 39 and see the mention of the bell and indeed that’s because of setting the title. Setting
console_titleto false will resolve that.I did not take the time to configure it extensively. Thanks for your config.
@lnu I’m going to create a POC to see if we can delegate the syscalls to a Rust lib. It’s perfectly possible and it could solve the issue entirely. See this repo for example.
It causes a functional issue in Clink, and should cause exactly the same functional issue in Bash, since both use the GNU Readline library which is the component affected by the oh-my-posh issue.
The CSI K escape code near the end of the prompt string can, under certain circumstances, accidentally erase the input text from the screen. Readline doesn’t expect anything else to be printing over its output, and for performance reasons it’s important not to print over or erase Readline’s output. But the CSI K escape code does.
The linked issue 40 has repro steps for one example scenario. Many other scenarios exist.