DECCOLM escape sequence doesn't work #249

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

Originally created by @j4james on GitHub (May 7, 2018).

  • Your Windows build number:

Microsoft Windows [Version 10.0.16299.371]

  • What you're doing and what's happening:

I'm trying to switch between 80 and 132 columns with the DECCOLM escape sequence (ESC [ ? 3 h), and although it clears the screen and resets the cursor position, it appears to have no effect on the actual width of the screen. This is my test case to enable 132 columns:

printf "\e[?3h"

After poking around in the code a bit, I noticed there is a test at the start of the AdaptDispatch::SetColumns method, which stops the call from have any effect if the member variable at offset 30h is false (which it is). If I manually set that value to true then the call works.

I thought this might mean the DECCOLM functionality was disabled by default (as it is in XTerm), but I couldn't see any option in the console properties that would enable it, and Windows doesn't seem to support the escape sequence that XTerm uses to enable it (ESC [ ? 40 h).

I should also mention that even when the SetColumn call is working, it doesn't actually function as I would it expect it to. Both XTerm and Gnome Terminal resize the actual window when the DECCOLM mode is toggled, but the Windows console just alters the buffer width, leaving the window size unchanged. Having those two widths out of sync introduces a whole host of other problems.

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

When the DECCOLM mode is set, I'd expect the screen width to change to 132. When it is reset, I'd expect the screen width to change to 80.

Originally created by @j4james on GitHub (May 7, 2018). * Your Windows build number: Microsoft Windows [Version 10.0.16299.371] * What you're doing and what's happening: I'm trying to switch between 80 and 132 columns with the DECCOLM escape sequence (`ESC [ ? 3 h`), and although it clears the screen and resets the cursor position, it appears to have no effect on the actual width of the screen. This is my test case to enable 132 columns: printf "\e[?3h" After poking around in the code a bit, I noticed there is a test at the start of the `AdaptDispatch::SetColumns` method, which stops the call from have any effect if the member variable at offset 30h is false (which it is). If I manually set that value to true then the call works. I thought this might mean the DECCOLM functionality was disabled by default (as it is in XTerm), but I couldn't see any option in the console properties that would enable it, and Windows doesn't seem to support the escape sequence that XTerm uses to enable it (`ESC [ ? 40 h`). I should also mention that even when the SetColumn call is working, it doesn't actually function as I would it expect it to. Both XTerm and Gnome Terminal resize the actual window when the DECCOLM mode is toggled, but the Windows console just alters the buffer width, leaving the window size unchanged. Having those two widths out of sync introduces a whole host of other problems. * What's wrong / what should be happening instead: When the DECCOLM mode is set, I'd expect the screen width to change to 132. When it is reset, I'd expect the screen width to change to 80.
claunia added the Issue-FeatureProduct-ConhostResolution-Fix-AvailableArea-VT labels 2026-01-30 21:46:52 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#249