-
Notifications
You must be signed in to change notification settings - Fork 8.5k
ConPTY translating [49m to [m escape sequence #362
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
Comments
Hey @brads55, thanks for reporting this! I think this is operating mostly as-expected. Since CSI If you set Code: wchar_t szCommand[]{ L"bash -c \"echo '\x1b[32;41mABCD\x1b[49mEFGH'\"" }; output
This optimization shouldn't have any observable side effects. #293 is caused by our current inability to support a color outside the palette as the default color; this should be somewhat improved in 19H1, but it won't be perfect yet. I'll add a more detailed comment over there. |
Hm, that was perhaps a bad example of what I'm seeing. There is certainly something strange going on with what I'm doing as there are seemingly missing colour codes in the output of what I have when compared to a non-conpty terminal. I'll dig into this a bit more and try and come up with a better example (or prove myself wrong!). |
If I had to guess, I'd think that maybe you're emitting something like Part of the trick here is that conpty can't just emit the raw escape sequences that are written to it, because it's possible that another attached client is using the Console API to query the state of the console buffer, so we need to both process the VT sequences written to us, then render the effects of both the VT sequences and the API calls to whoever is attached to the conpty side of the console. |
I haven't had chance to check yet but yes that does seem like exactly what is happening, since what I'm essentially trying to do is exactly what the above comment in the link DHowett-MSFT made describes, that is, set the default background colour to a colour outside of the normal palette. I see it was noted that this is fixed in 19H1 but not enabled for ConPTY, is this likely to change or will this not be fixed for ConPTY until after 19H1? (I also suppose there is no workaround for this in the mean time?) |
Looking at this again, yes this is indeed what is happening, a [40m is being removed. Hence this is issue is just a duplicate of #293. |
@brads55, thanks for confirming! I'll close this out as a dupe then. |
ver
at a Windows Command Prompt)Microsoft Windows [Version 10.0.17763.292]
When using the new ConPTY feature it seems there is some behind the scenes optimisation happening surrounding colours that is assuming colour state. For example when using the default background/foreground escape sequences ([49m/[39m), they are either getting removed or changed into a reset sequence ([m), this make it difficult to write a frontend to ConPTY that wants to for example have a window background colour that isn't one of the colours specified by the escape sequences. (i.e. where [m and [49m would do different things).
And example of this is at https://github.com/brads55/conpty-testcase (based on the EchoCon sample), where the following can be seen:
I also suspect this is the cause of #293.
It would be great if either these optimisations didn't happen or there was at least a way of disabling them in order to get the real raw escape sequences.
The text was updated successfully, but these errors were encountered: