From 11f98592f7fd243e1667691cebef3c051dca017b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 23 Jan 2023 16:33:08 +0530 Subject: [PATCH] We still need full keyboard protocol for @ send-text --- tools/cmd/at/tty_io.go | 3 +++ tools/tui/loop/api.go | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/tools/cmd/at/tty_io.go b/tools/cmd/at/tty_io.go index 9ef837a5b..994ce9bb2 100644 --- a/tools/cmd/at/tty_io.go +++ b/tools/cmd/at/tty_io.go @@ -27,6 +27,9 @@ func is_stream_response(serialized_response []byte) bool { func do_chunked_io(io_data *rc_io_data) (serialized_response []byte, err error) { serialized_response = make([]byte, 0) lp, err := loop.New(loop.NoAlternateScreen, loop.NoRestoreColors, loop.OnlyDisambiguateKeys) + if io_data.on_key_event != nil { + lp.FullKeyboardProtocol() + } if err != nil { return } diff --git a/tools/tui/loop/api.go b/tools/tui/loop/api.go index c8395f980..94cbf21e7 100644 --- a/tools/tui/loop/api.go +++ b/tools/tui/loop/api.go @@ -133,6 +133,15 @@ func OnlyDisambiguateKeys(self *Loop) { self.terminal_options.kitty_keyboard_mode = 0b1 } +func (self *Loop) FullKeyboardProtocol() *Loop { + self.terminal_options.kitty_keyboard_mode = 0b11111 + return self +} + +func FullKeyboardProtocol(self *Loop) { + self.terminal_options.kitty_keyboard_mode = 0b11111 +} + func (self *Loop) MouseTrackingMode(mt MouseTracking) *Loop { self.terminal_options.mouse_tracking = mt return self