Skip to content

Commit

Permalink
fix: don't eat escape key
Browse files Browse the repository at this point in the history
  • Loading branch information
cfoust committed Jan 22, 2024
1 parent e2704d7 commit 8c9b411
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/mux/screen/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions pkg/taro/key_constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down

0 comments on commit 8c9b411

Please sign in to comment.