tui: explicitly turn off in-band resize mode

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.
This commit is contained in:
Tim Culverhouse
2024-11-18 10:51:14 -06:00
parent 1ff74b86dc
commit 4b354fbd30

View File

@@ -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)