Add support for resetting tab stops (DECST8C) #21064

Closed
opened 2026-01-31 07:32:08 +00:00 by claunia · 2 comments
Owner

Originally created by @j4james on GitHub (Jan 6, 2024).

Description of the new feature/enhancement

DECST8C is an escape sequence which resets the tab stops to their default values, i.e. every 8 columns. It's especially useful for a modern terminal because it's the only practical way to restore the default values over an "infinite" width. Without this you'd have to set the positions manually, which limits you to the current screen width (technically you could also perform a hard reset with RIS, but that's not something an application should be doing).

Proposed technical implementation details (optional)

We actually already have a method in AdaptDispatch that performs a tab reset (it's used in the hard reset implementation). We just need to make it public, and hook it up to the relevant escape sequence in the state machine.

It's a little bit more complicated than I'm making out, because the escape sequence takes a parameter value, and DECST8C is only applicable for one specific value, but that's easy enough to handle.

Originally created by @j4james on GitHub (Jan 6, 2024). # Description of the new feature/enhancement [`DECST8C`](https://vt100.net/docs/vt510-rm/DECST8C.html) is an escape sequence which resets the tab stops to their default values, i.e. every 8 columns. It's especially useful for a modern terminal because it's the only practical way to restore the default values over an "infinite" width. Without this you'd have to set the positions manually, which limits you to the current screen width (technically you could also perform a hard reset with `RIS`, but that's not something an application should be doing). # Proposed technical implementation details (optional) We actually already have a method in `AdaptDispatch` that performs a tab reset (it's used in the hard reset implementation). We just need to make it public, and hook it up to the relevant escape sequence in the state machine. It's a little bit more complicated than I'm making out, because the escape sequence takes a parameter value, and `DECST8C` is only applicable for one specific value, but that's easy enough to handle.
claunia added the Issue-FeatureHelp WantedProduct-ConhostIn-PRArea-VT labels 2026-01-31 07:32:08 +00:00
Author
Owner

@ClaireCJS commented on GitHub (Sep 9, 2024):

I have my own internal notation i use, but i just used tab stops today for the first time and they worked....

I basically cleared all tab stops, moved to column 7, set one there, and then the colortool.exe chart aligned properly:
image
(column 1 was the only one with variable-width–values in it to screw up the tabbing, so I only needed to set that 1 tab-stop to fix it)

@ClaireCJS commented on GitHub (Sep 9, 2024): I have my own internal notation i use, but i just used tab stops today for the first time and they worked.... I basically cleared all tab stops, moved to column 7, set one there, and then the colortool.exe chart aligned properly: ![image](https://github.com/user-attachments/assets/7d65f694-b2fa-457f-8b53-9fe543af1510) (column 1 was the only one with variable-width–values in it to screw up the tabbing, so I only needed to set that 1 tab-stop to fix it)
Author
Owner

@j4james commented on GitHub (Sep 10, 2024):

@ClaireCJS If you wanted to reset all the tab stops to the default 8 column spacing (which is what colortool is really expecting), you could also just use echo %ESCAPE%[?W (that's the DECST8C sequence that we added here).

@j4james commented on GitHub (Sep 10, 2024): @ClaireCJS If you wanted to reset all the tab stops to the default 8 column spacing (which is what colortool is really expecting), you could also just use `echo %ESCAPE%[?W` (that's the `DECST8C` sequence that we added here).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21064