Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

Commit

Permalink
engine: exit on Ctrl-D, just like Ctrl-C
Browse files Browse the repository at this point in the history
Many common CLI applications quit when stdin reaches end-of-file, as
triggered by Ctrl-D. (Examples: `python`, `bash`, `node`, `gdb`, `ed`.)
Though `jiq` is more of a TUI than a CLI, exiting with Ctrl-D still
feels familiar and intuitive to me, and was how I tried to exit `jiq`
the first time that I used it.

wchargin-branch: ctrl-d-exit
wchargin-source: b3ac9be9ce4378b8c3eb82e6d3bc3bb6403d3309
  • Loading branch information
wchargin authored and fiatjaf committed Aug 25, 2021
1 parent 34b0a61 commit 5dec899
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (e *Engine) Run() *EngineResult {
}
}
e.confirmCandidate()
case termbox.KeyCtrlC:
case termbox.KeyCtrlC, termbox.KeyCtrlD:
return &EngineResult{}
default:
}
Expand Down

0 comments on commit 5dec899

Please sign in to comment.