mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +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:
@@ -146,9 +146,16 @@ func main(_ *cli.Command, opts_ *Options, args []string) (rc int, err error) {
|
||||
lp.SetCursorShape(loop.BAR_CURSOR, true)
|
||||
lp.AllowLineWrapping(false)
|
||||
lp.SetWindowTitle(fmt.Sprintf("%s vs. %s", left, right))
|
||||
lp.QueryCapabilities()
|
||||
h.initialize()
|
||||
return "", nil
|
||||
}
|
||||
lp.OnCapabilitiesReceived = func(tc loop.TerminalCapabilities) error {
|
||||
if !tc.KeyboardProtocol {
|
||||
return fmt.Errorf("This terminal does not support the kitty keyboard protocol, or you are running inside a terminal multiplexer that is blocking querying for kitty keyboard protocol support. The diff kitten cannot function without it.")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
lp.OnWakeup = h.on_wakeup
|
||||
lp.OnFinalize = func() string {
|
||||
lp.SetCursorVisible(true)
|
||||
|
||||
Reference in New Issue
Block a user