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

Commit 5dec899

Browse files
wcharginfiatjaf
authored andcommitted
engine: exit on Ctrl-D, just like Ctrl-C
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
1 parent 34b0a61 commit 5dec899

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func (e *Engine) Run() *EngineResult {
168168
}
169169
}
170170
e.confirmCandidate()
171-
case termbox.KeyCtrlC:
171+
case termbox.KeyCtrlC, termbox.KeyCtrlD:
172172
return &EngineResult{}
173173
default:
174174
}

0 commit comments

Comments
 (0)