From 8c9b4113d76c1ed32272803bff695b68db68827e Mon Sep 17 00:00:00 2001 From: Caleb Foust Date: Mon, 22 Jan 2024 19:47:59 +0800 Subject: [PATCH] fix: don't eat escape key --- pkg/mux/screen/terminal.go | 1 + pkg/taro/key_constants.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pkg/mux/screen/terminal.go b/pkg/mux/screen/terminal.go index 6ed55ce1..5828a770 100644 --- a/pkg/mux/screen/terminal.go +++ b/pkg/mux/screen/terminal.go @@ -40,6 +40,7 @@ func (t *Terminal) Send(msg mux.Msg) { switch msg := msg.(type) { case taro.KeyMsg: + // TODO(cfoust): 01/22/24 error handling data, _ := taro.KeysToBytes(msg) input = data case taro.MouseMsg: diff --git a/pkg/taro/key_constants.go b/pkg/taro/key_constants.go index 3f5085ef..7f9a3147 100644 --- a/pkg/taro/key_constants.go +++ b/pkg/taro/key_constants.go @@ -333,6 +333,8 @@ var keyRefs = map[string]KeyType{ // Sequence mappings. var sequences = map[string]Key{ + "\x1b": {Type: KeyEscape}, + // Arrow keys "\x1b[A": {Type: KeyUp}, "\x1b[B": {Type: KeyDown},