mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 22:44:50 +02:00
diff kitten: Automatically change colors on terminal color scheme change
This commit is contained in:
@@ -118,6 +118,9 @@ type Loop struct {
|
||||
|
||||
// Called when capabilities response is received
|
||||
OnCapabilitiesReceived func(TerminalCapabilities) error
|
||||
|
||||
// Called when the terminal's color scheme changes
|
||||
OnColorSchemeChange func(ColorPreference) error
|
||||
}
|
||||
|
||||
func New(options ...func(self *Loop)) (*Loop, error) {
|
||||
@@ -203,6 +206,15 @@ func NoRestoreColors(self *Loop) {
|
||||
self.terminal_options.restore_colors = false
|
||||
}
|
||||
|
||||
func (self *Loop) ColorSchemeChangeNotifications() *Loop {
|
||||
self.terminal_options.color_scheme_change_notification = true
|
||||
return self
|
||||
}
|
||||
|
||||
func ColorSchemeChangeNotifications(self *Loop) {
|
||||
self.terminal_options.color_scheme_change_notification = true
|
||||
}
|
||||
|
||||
func NoInBandResizeNotifications(self *Loop) {
|
||||
self.terminal_options.in_band_resize_notification = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user