Handle color scheme changes in choose-files kitten

This commit is contained in:
Kovid Goyal
2025-07-20 13:43:59 +05:30
parent 9068bbaba9
commit 2bdbbd909c
4 changed files with 37 additions and 0 deletions

View File

@@ -218,6 +218,10 @@ func NoFocusTracking(self *Loop) {
self.terminal_options.focus_tracking = false
}
func (self *Loop) RequestCurrentColorScheme() {
self.QueueWriteString("\x1b[?996n")
}
func (self *Loop) ColorSchemeChangeNotifications() *Loop {
self.terminal_options.color_scheme_change_notification = true
return self

View File

@@ -14,6 +14,17 @@ const (
LIGHT_COLOR_PREFERENCE
)
func (c ColorPreference) String() string {
switch c {
case DARK_COLOR_PREFERENCE:
return "dark"
case LIGHT_COLOR_PREFERENCE:
return "light"
default:
return "no-preference"
}
}
type TerminalCapabilities struct {
KeyboardProtocol bool
KeyboardProtocolResponseReceived bool