mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-11 18:32:12 +02:00
@@ -209,6 +209,15 @@ func NoRestoreColors(self *Loop) {
|
||||
self.terminal_options.restore_colors = false
|
||||
}
|
||||
|
||||
func (self *Loop) NoFocusTracking() *Loop {
|
||||
self.terminal_options.focus_tracking = false
|
||||
return self
|
||||
}
|
||||
|
||||
func NoFocusTracking(self *Loop) {
|
||||
self.terminal_options.focus_tracking = false
|
||||
}
|
||||
|
||||
func (self *Loop) ColorSchemeChangeNotifications() *Loop {
|
||||
self.terminal_options.color_scheme_change_notification = true
|
||||
return self
|
||||
|
||||
@@ -26,6 +26,7 @@ func new_loop() *Loop {
|
||||
l := Loop{controlling_term: nil}
|
||||
l.terminal_options.Alternate_screen = true
|
||||
l.terminal_options.restore_colors = true
|
||||
l.terminal_options.focus_tracking = true
|
||||
l.terminal_options.in_band_resize_notification = true
|
||||
l.terminal_options.color_scheme_change_notification = false
|
||||
l.terminal_options.kitty_keyboard_mode = DISAMBIGUATE_KEYS | REPORT_ALTERNATE_KEYS | REPORT_ALL_KEYS_AS_ESCAPE_CODES | REPORT_TEXT_WITH_KEYS
|
||||
|
||||
@@ -102,6 +102,7 @@ type TerminalStateOptions struct {
|
||||
mouse_tracking MouseTracking
|
||||
kitty_keyboard_mode KeyboardStateBits
|
||||
in_band_resize_notification bool
|
||||
focus_tracking bool
|
||||
color_scheme_change_notification bool
|
||||
}
|
||||
|
||||
@@ -131,7 +132,10 @@ func (self *TerminalStateOptions) SetStateEscapeCodes() string {
|
||||
reset_modes(&sb,
|
||||
IRM, DECKM, DECSCNM, BRACKETED_PASTE,
|
||||
MOUSE_BUTTON_TRACKING, MOUSE_MOTION_TRACKING, MOUSE_MOVE_TRACKING, MOUSE_UTF8_MODE, MOUSE_SGR_MODE)
|
||||
set_modes(&sb, DECARM, DECAWM, DECTCEM, FOCUS_TRACKING)
|
||||
set_modes(&sb, DECARM, DECAWM, DECTCEM)
|
||||
if self.focus_tracking {
|
||||
set_modes(&sb, FOCUS_TRACKING)
|
||||
}
|
||||
if self.in_band_resize_notification {
|
||||
set_modes(&sb, INBAND_RESIZE_NOTIFICATION)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user