Skip to content

Commit

Permalink
Fixed Rawterm mode being left on
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexidian committed Feb 1, 2022
1 parent dc87100 commit 22987df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gocliselect.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ func getInput() byte {
readBytes := make([]byte, 3)
read, err = t.Read(readBytes)

t.Restore()
t.Close()

// Arrow keys are prefixed with the ANSI escape code which take up the first two bytes.
// The third byte is the key specific value we are looking for.
// For example the left arrow key is '<esc>[A' while the right is '<esc>[C'
Expand All @@ -145,7 +148,5 @@ func getInput() byte {
return readBytes[0]
}

t.Restore()
t.Close()
return 0
}

0 comments on commit 22987df

Please sign in to comment.