ConPTY translating [49m to [m escape sequence #540

Open
opened 2026-01-30 21:54:43 +00:00 by claunia · 0 comments
Owner

Originally created by @brads55 on GitHub (Jan 27, 2019).

  • Your Windows build number: (Type ver at a Windows Command Prompt)

Microsoft Windows [Version 10.0.17763.292]

  • What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots)

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:

testcase

I also suspect this is the cause of #293.

  • What's wrong / what should be happening instead:

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.

Originally created by @brads55 on GitHub (Jan 27, 2019). * Your Windows build number: (Type `ver` at a Windows Command Prompt) Microsoft Windows [Version 10.0.17763.292] * What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots) 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: ![testcase](https://user-images.githubusercontent.com/8070284/51805191-5766b900-2262-11e9-95a9-ef6268d29990.png) I also suspect this is the cause of #293. * What's wrong / what should be happening instead: 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.
claunia added the Area-VTResolution-DuplicateProduct-Conpty labels 2026-01-30 21:54:43 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#540