Re-enable support for DECKPAM #21203

Open
opened 2026-01-31 07:36:22 +00:00 by claunia · 2 comments
Owner

Originally created by @zadjii-msft on GitHub (Feb 6, 2024).

This was originally tracked in #16506.
Support was added in #16511.
But turns out people didn't expect the Terminal to actually be like, compliant: #16654

So now we're gonna add a setting to be able to manually enable/disable support for toggling this mode.

The trick here? ConPTY is the thing that's going to need to do the input translation, not the Terminal. So, the Terminal needs a way to tell conpty (at runtime)1 if this is a mode that's allowed or not. And that, we don't have a good system set up for currently.


  1. Leonard keeps terrifyingly calling this ConPTY IOCTL ↩︎

Originally created by @zadjii-msft on GitHub (Feb 6, 2024). This was originally tracked in #16506. Support was added in #16511. But turns out people didn't expect the Terminal to actually be like, compliant: #16654 So now we're gonna add a setting to be able to manually enable/disable support for toggling this mode. The trick here? ConPTY is the thing that's going to need to do the input translation, not the Terminal. So, the Terminal needs a way to tell conpty (at runtime)[^1] if this is a mode that's allowed or not. And that, we don't have a good system set up for currently. [^1]: Leonard keeps terrifyingly calling this ConPTY IOCTL
claunia added the Help WantedIssue-TaskIn-PRArea-InputArea-VTProduct-Terminal labels 2026-01-31 07:36:23 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Feb 6, 2024):

A thought: if we made the setting not necessarily hot reload, we could use the --flag as discussed in #15504, #1802 to statically initialize conpty with or without support for DECKPAM

@zadjii-msft commented on GitHub (Feb 6, 2024): A thought: if we made the setting not necessarily hot reload, we could use the `--flag` as discussed in #15504, #1802 to statically initialize conpty with or without support for DECKPAM
Author
Owner

@j4james commented on GitHub (Feb 6, 2024):

On the broader issue of passing settings from the conpty terminal down to conhost, I think it's worth considering some of the other places we may want to use it, because the different use cases may influence the way we choose to implement it.

There have been a couple of other cases similar to DECKPAM, where users have wanted to block a particular mode. One common one is cursor blinking (mode ?12), which comes up quite a lot (these are just some examples):

Another less common one is the alternate screen buffer (mode ?1049), usually in relation to the screen multiplexer:

Then there are the situations where conhost needs to report state that it doesn't know about, because that state is initialized (and potentially updated) by the conpty client.:

While the modes would probably be OK if only initialized at startup, for things like the palette and cursor shape I think it's quite important to support real-time updates, because the user will see those changes immediately, and will expect any query APIs to reflect what they're seeing.

And the other thing to consider is how this could work (if at all) when conpty is used as the basis for a telnet/ssh server. There's no opportunity there for the terminal to pass flags on the command line, or over a ioctl-like backchannel (at least as far I know).

One my initial ideas what that this could be handled by querying the connected conpty terminal on startup. That way we could use standard VT sequences, which should just work automatically with most conpty clients. But if we want real-time updates, that's not going to cut it - some mechanism for pushing updates from the terminal side would be required.

But maybe we just have to accept that the telnet/ssh situation will never be perfect.

@j4james commented on GitHub (Feb 6, 2024): On the broader issue of passing settings from the conpty terminal down to conhost, I think it's worth considering some of the other places we may want to use it, because the different use cases may influence the way we choose to implement it. There have been a couple of other cases similar to `DECKPAM`, where users have wanted to block a particular mode. One common one is cursor blinking (mode ?12), which comes up quite a lot (these are just some examples): * #10754 * #10919 * #11209 * #12372 Another less common one is the alternate screen buffer (mode ?1049), usually in relation to the *screen* multiplexer: * #13670 * #13703 Then there are the situations where conhost needs to report state that it doesn't know about, because that state is initialized (and potentially updated) by the conpty client.: * #3718 * #10639 * #11946 * Querying the current cursor shape with `DECRQSS` (I don't think this is tracked anywhere). While the modes would probably be OK if only initialized at startup, for things like the palette and cursor shape I think it's quite important to support real-time updates, because the user will see those changes immediately, and will expect any query APIs to reflect what they're seeing. And the other thing to consider is how this could work (if at all) when conpty is used as the basis for a telnet/ssh server. There's no opportunity there for the terminal to pass flags on the command line, or over a ioctl-like backchannel (at least as far I know). One my initial ideas what that this could be handled by querying the connected conpty terminal on startup. That way we could use standard VT sequences, which should just work automatically with most conpty clients. But if we want real-time updates, that's not going to cut it - some mechanism for pushing updates from the terminal side would be required. But maybe we just have to accept that the telnet/ssh situation will never be perfect.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21203