terminal fix hack
This commit is contained in:
parent
1e45d360b4
commit
5f4bad3634
1 changed files with 4 additions and 0 deletions
4
main.go
4
main.go
|
@ -148,11 +148,15 @@ func main() {
|
|||
keyboard.Listen(func(key keys.Key) (stop bool, err error) {
|
||||
if !state.IsInPrompt() {
|
||||
if key.Code == keys.CtrlC {
|
||||
term.Restore(int(os.Stdin.Fd()), oldState)
|
||||
commands.QuitCommand()
|
||||
return true, nil
|
||||
} else {
|
||||
command, has := commands.GetCommand(key.String())
|
||||
if has {
|
||||
if key.String() == "q" {
|
||||
term.Restore(int(os.Stdin.Fd()), oldState)
|
||||
}
|
||||
command.Run()
|
||||
} else {
|
||||
commands.SendMode()
|
||||
|
|
Loading…
Reference in a new issue