mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 22:28:24 +02:00
@@ -30,8 +30,8 @@ func do_chunked_io(io_data *rc_io_data) (serialized_response []byte, err error)
|
|||||||
// we cant do inbandresize notification as in the --no-response case the
|
// we cant do inbandresize notification as in the --no-response case the
|
||||||
// command can cause a resize and the loop can quit before the notification
|
// command can cause a resize and the loop can quit before the notification
|
||||||
// arrives, leading to the notification being sent to whatever is executed
|
// arrives, leading to the notification being sent to whatever is executed
|
||||||
// after us.
|
// after us. Similarly no focus tracking.
|
||||||
lp, err := loop.New(loop.NoAlternateScreen, loop.NoRestoreColors, loop.NoInBandResizeNotifications)
|
lp, err := loop.New(loop.NoAlternateScreen, loop.NoRestoreColors, loop.NoInBandResizeNotifications, loop.NoFocusTracking)
|
||||||
if io_data.on_key_event != nil {
|
if io_data.on_key_event != nil {
|
||||||
lp.FullKeyboardProtocol()
|
lp.FullKeyboardProtocol()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -209,6 +209,15 @@ func NoRestoreColors(self *Loop) {
|
|||||||
self.terminal_options.restore_colors = false
|
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 {
|
func (self *Loop) ColorSchemeChangeNotifications() *Loop {
|
||||||
self.terminal_options.color_scheme_change_notification = true
|
self.terminal_options.color_scheme_change_notification = true
|
||||||
return self
|
return self
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ func new_loop() *Loop {
|
|||||||
l := Loop{controlling_term: nil}
|
l := Loop{controlling_term: nil}
|
||||||
l.terminal_options.Alternate_screen = true
|
l.terminal_options.Alternate_screen = true
|
||||||
l.terminal_options.restore_colors = true
|
l.terminal_options.restore_colors = true
|
||||||
|
l.terminal_options.focus_tracking = true
|
||||||
l.terminal_options.in_band_resize_notification = true
|
l.terminal_options.in_band_resize_notification = true
|
||||||
l.terminal_options.color_scheme_change_notification = false
|
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
|
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
|
mouse_tracking MouseTracking
|
||||||
kitty_keyboard_mode KeyboardStateBits
|
kitty_keyboard_mode KeyboardStateBits
|
||||||
in_band_resize_notification bool
|
in_band_resize_notification bool
|
||||||
|
focus_tracking bool
|
||||||
color_scheme_change_notification bool
|
color_scheme_change_notification bool
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,7 +132,10 @@ func (self *TerminalStateOptions) SetStateEscapeCodes() string {
|
|||||||
reset_modes(&sb,
|
reset_modes(&sb,
|
||||||
IRM, DECKM, DECSCNM, BRACKETED_PASTE,
|
IRM, DECKM, DECSCNM, BRACKETED_PASTE,
|
||||||
MOUSE_BUTTON_TRACKING, MOUSE_MOTION_TRACKING, MOUSE_MOVE_TRACKING, MOUSE_UTF8_MODE, MOUSE_SGR_MODE)
|
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 {
|
if self.in_band_resize_notification {
|
||||||
set_modes(&sb, INBAND_RESIZE_NOTIFICATION)
|
set_modes(&sb, INBAND_RESIZE_NOTIFICATION)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user