From c078fbbb029fd248756ea5d7726f9ae6090a4ee3 Mon Sep 17 00:00:00 2001 From: delthas Date: Mon, 12 Jul 2021 19:54:52 +0200 Subject: 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". --- ui/ui.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ui/ui.go') diff --git a/ui/ui.go b/ui/ui.go index 0b45a3c..4ced9f0 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -228,6 +228,10 @@ func (ui *UI) InputEnter() (content string) { return ui.e.Flush() } +func (ui *UI) InputClear() { + ui.e.Clear() +} + func (ui *UI) Resize() { w, h := ui.screen.Size() ui.e.Resize(w - 9 - ui.config.ChanColWidth - ui.config.NickColWidth) -- cgit v1.2.3