summaryrefslogtreecommitdiff
path: root/app.go
diff options
context:
space:
mode:
authordelthas <delthas@dille.cc>2021-07-12 19:54:52 +0200
committerHubert Hirtz <hubert@hirtz.pm>2021-07-13 19:21:08 +0200
commitc078fbbb029fd248756ea5d7726f9ae6090a4ee3 (patch)
tree22577d5ea43eb26d75cdbd065bfbdcd4088884fc /app.go
parentRatelimit +typing and send +typing=done once only (diff)
Clear the input on CTRL+C instead of quitting
We have /QUIT for quitting. Most well-known IRC clients don't quit on CTRL+C but they do on QUIT. Clearing the editor input on CTRL+C is useful for shell-like behaviour "abort current line, let me start my line again".
Diffstat (limited to 'app.go')
-rw-r--r--app.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/app.go b/app.go
index 57c12de..272cd40 100644
--- a/app.go
+++ b/app.go
@@ -320,7 +320,8 @@ func (app *App) handleMouseEvent(ev *tcell.EventMouse) {
func (app *App) handleKeyEvent(ev *tcell.EventKey) {
switch ev.Key() {
case tcell.KeyCtrlC:
- app.win.Exit()
+ app.win.InputClear()
+ app.typing()
case tcell.KeyCtrlL:
app.win.Resize()
case tcell.KeyCtrlU, tcell.KeyPgUp: