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

Text flow to next line broken when ESC]9;8; is used #563

Closed
eugenesvk opened this issue Mar 1, 2016 · 7 comments
Closed

Text flow to next line broken when ESC]9;8; is used #563

eugenesvk opened this issue Mar 1, 2016 · 7 comments

Comments

@eugenesvk
Copy link

I'm trying to display current username in prompt via:
prompt $E]9;8;"USERNAME"$E\

However, if I use it, while current Username is indeed displayed, the text reflow is broken — when I enter a long command that doesn't fit in one line, instead of continuing to the 2nd line I start from the same line (the prompt text and the previous text of the command get overwritten) and only with the next line does the text flows to the next line (so it's visually 2nd line although it's supposed to be 3rd).
See the screenshot below: notice there is no Username on the left, multiple pastes of the same test "LongCommandText" just continues on the SAME line instead of jumping down to the second.
conemu promptbug2

Similar thing happens when I invoke a long command from history (with Up) — prompt text gets overwritten and I lose some of the text in the beginning (instead, when I use Left to reach the beginning, there is a bunch of white spaces displayed instead of actual text).
Also, another visual artifact: if I invoke a command (even some short one) from history and go back to no command (i.e. Up then Down or just try to delete the whole line), I still get some text displayed in my prompt (see screenshot below, where "prompt $E]9;" shouldn't be there, it's a command from history that I can't delete)
conemu promptbug

System:
CMDer 1.2.9
ConEmu 160228 [32]
Windows 10.0.10586

@eugenesvk
Copy link
Author

Just tested with a fresh install of ConEmu 160228 portable and this bug is not reproduced. Seems some cmder settings interfere or something. Will leave this open while trying to isolate what the exact cause of this issue is.

@eugenesvk
Copy link
Author

The issue appears when I enable https://github.com/mridgers/clink. Using default fresh install, no settings changed.
Any idea why this is happening? Will also open an issue with clink, not sure what is going on here :(

@Maximus5
Copy link
Owner

Maximus5 commented Mar 1, 2016

Clink do not know anything about ConEmu specific OSC. Reflow is triggered by clink, but I don't think it's a bug, but limitation.
Perhaps, it's preferable to configure prompt via clink profile.

@eugenesvk
Copy link
Author

Thanks for a prompt response!
Do you have an idea whether there is a way to make clink aware of these codes?
I'm trying to shift to configuring prompt via clink, but it's much harder for me since it's lua and not many examples to copy&paste&adjust from, documentation isn't great :(

@Maximus5
Copy link
Owner

Maximus5 commented Mar 1, 2016

Finally, I consider this is a clink problem and clink must take into account length of OSC codes (strip them or somehow ).

Also interesting, when you type the command and press Esc, part of the command is not erased.

Anyway, ConEmu can't change or "fix" clink's internals.

@eugenesvk
Copy link
Author

Yep, Esc doesn't remove part of the command either.
Understand it's a clink issue, will close this one and hope clink will implement a fix that would account for OSC codes.

@andreymir
Copy link

andreymir commented Apr 15, 2016

I have been playing with different PROMPT options and replacing the line set ConEmuPrompt3=$E[m$S$E]9;12$E\ with set ConEmuPrompt3=$S$E[0;37;40m in the ConEmu\CmdInit.cmd fixes the issue. And I haven't noticed any visual changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants