Skip to content

Commit

Permalink
Set OnKey to a new empty map to prevent nil map assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
bytedream committed Oct 25, 2021
1 parent 0182cb6 commit 891a970
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ type Terminal struct {
func NewTerminal(c io.ReadWriter, prompt string) *Terminal {
return &Terminal{
Escape: &vt100EscapeCodes,
OnKey: map[rune]func(key rune) (resume bool){},
c: c,
prompt: []rune(prompt),
termWidth: 80,
Expand Down

0 comments on commit 891a970

Please sign in to comment.