mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-17 22:14:53 +02:00
diff kitten: Abort when run inside a terminal that does not support the kitty keyboard protocol
Fixes #8185
This commit is contained in:
@@ -117,7 +117,7 @@ type Loop struct {
|
||||
OnSIGTERM func() (bool, error)
|
||||
|
||||
// Called when capabilities response is received
|
||||
OnCapabilitiesReceived func(TerminalCapabilities)
|
||||
OnCapabilitiesReceived func(TerminalCapabilities) error
|
||||
}
|
||||
|
||||
func New(options ...func(self *Loop)) (*Loop, error) {
|
||||
|
||||
@@ -128,7 +128,9 @@ func (self *Loop) handle_csi(raw []byte) (err error) {
|
||||
if strings.HasPrefix(csi, "?") && strings.HasSuffix(csi, "c") {
|
||||
self.waiting_for_capabilities_response = false
|
||||
if self.OnCapabilitiesReceived != nil {
|
||||
self.OnCapabilitiesReceived(self.TerminalCapabilities)
|
||||
if err = self.OnCapabilitiesReceived(self.TerminalCapabilities); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else if strings.HasPrefix(csi, "?997;") && strings.HasSuffix(csi, "n") {
|
||||
switch csi[len(csi)-2] {
|
||||
|
||||
Reference in New Issue
Block a user