Skip to content

Commit

Permalink
tui: explicitly turn off in-band resize mode
Browse files Browse the repository at this point in the history
Explicitly turn off in-band resize notifications if they were requested
as part of the loop. Kitty implicitly resets this mode when `XTRESTORE`
(`CSI ? r`) is seen, however some terminals implementing mode 2048
(eg foot and Ghostty) follow the xterm behavior of only restoring the
state of explicitly passed modes.

Some of the kittens have become very useful outside of just Kitty
(`show-key`, for example). Add an explicit reset of mode 2048 to support
the behavior of other terminal emulators.
  • Loading branch information
rockorager committed Nov 18, 2024
1 parent 1ff74b8 commit 4b354fb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/tui/loop/terminal-state.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ func (self *TerminalStateOptions) ResetStateEscapeCodes() string {
} else {
sb.WriteString(SAVE_CURSOR)
}
if self.in_band_resize_notification {
reset_modes(&sb, INBAND_RESIZE_NOTIFICATION)
}
sb.WriteString(RESTORE_PRIVATE_MODE_VALUES)
if self.restore_colors {
sb.WriteString(RESTORE_COLORS)
Expand Down

0 comments on commit 4b354fb

Please sign in to comment.