Repository navigation
terminal: support DECSTR - #14538
Merged
Merged
terminal: support DECSTR#14538
Conversation
korikhin
reviewed
Oct 6, 2026
Programs and test suites use DECSTR (CSI ! p) to undo the modes, margins, and pen they may have left behind without clearing the screen. It was ignored, so that state leaked into whatever ran next.
vancluever
approved these changes
Oct 9, 2026
vancluever
left a comment
Contributor
There was a problem hiding this comment.
I think this looks good!
Tested by hiding cursor w/DECTCEM and then resetting w/DECSTR.
trancong12102
added a commit
to aislopware/ghostty
that referenced
this pull request
Oct 9, 2026
Takes DECSTR (ghostty-org#14538), the single shift on exactly one printed character (ghostty-org#14576) and origin-mode cursor positions in VT format (ghostty-org#14588). Conflicts: - Terminal.zig: keep the fork's default_prompt_redraw beside upstream's DECSTR wording. DECSTR leaves shell_redraws_prompt alone: it is shell integration state, not a mode a program set. - formatter.zig: keep the fork's cursor emitter (pending wrap at the right margin, shape, saved cursor), and take upstream's rule for where CUP counts from: `cursor_origin` (now optional) is set only when the output restores both origin mode and the scrolling region. The saved cursor counts from the margins when DECSC saved it under origin mode, as before.
Dicklesworthstone
pushed a commit
to Dicklesworthstone/opentui
that referenced
this pull request
Oct 26, 2026
A program in an embedded terminal that changed palette colors with OSC 4 kept those colors after RIS (`ESC c`, what `reset` sends), and the vendored Ghostty ignored DECSTR (`CSI ! p`). xterm restores the palette on both and keeps the OSC 10, 11, and 12 colors. Update Ghostty from 727b8a02f to aeda37b30. DECSTR support landed in b115e4567 (ghostty-org/ghostty#14538), the oldest commit whose fullReset and softReset both reset the palette; aeda37b30 (#14643) adds that DECSTR also turns off ISO character protection, as in xterm. Ghostty needs the uucode 9d55524 code (BreakState.table_len), so the uucode-ghostty pin moves too. That uucode ships Unicode 18 data, which would give the embedded terminal other widths than OpenTUI text and most hosts (Unicode 17), so update-zig-deps.sh copies OpenTUI's Unicode 17 data files into Ghostty's uucode; the next Ghostty update must revisit this. Rows pin the agreement: U+1F6D9 (unassigned in 17) is one cell and U+1CF5 U+0915 two cells in OpenTUI text, in the grid, and after a replay into Ghostty. Other changes the embedded terminal needs: - The write_pty effect now passes a slice without a sentinel. - Kitty graphics now needs wuffs, which the archive does not carry, so Ghostty builds with -Dvt-features=-kitty-graphics. That compiles out the Kitty image storage and the replies the previous commit silenced, so the zero storage limit goes away; its test now checks that the storage type is empty. The new Ghostty also changes other behavior: DECSTR resets the modes and state xterm resets; a bare CSI g clears the tab stop at the cursor; it answers ANSI-mode DECRQM, DECECM, Ghostty's terminfo through XTGETTCAP, and Kitty clipboard requests (EPERM/ENOSYS); DECRQSS reports overline; CAN and SUB cancel OSC; C0 0x10-0x1F and UTF-8 C1 controls no longer draw cells; selection highlight at wide-character edges follows copying; and it encodes F13-F25 and modifyOtherKeys 2 ctrl keys. The pull request lists these. No existing test changes. Source net +1: build.zig +3 (the vt-features option and two comment lines with its reason), main.zig -2 (the storage limit and its comment). Vendor script +6: the Unicode 17 data copy and its reason. Issue: 192 Fixes anomalyco#1695
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Programs and test suites use DECSTR (CSI ! p) to undo the modes, margins, and pen they may have left behind without clearing the screen. It was ignored, so that state leaked into whatever ran next.