From 50ce0200af5648818e6e4f51d6541bd3bdb7e036 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Wed, 4 Mar 2026 08:29:47 +0300 Subject: Fix: graceful shutdown in tui, to avoid other key block --- tui.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tui.go') diff --git a/tui.go b/tui.go index 4a8a7b2..67f2775 100644 --- a/tui.go +++ b/tui.go @@ -1001,6 +1001,17 @@ func init() { showBotRoleSelectionPopup() return nil } + // INFO: shutdown + if event.Key() == tcell.KeyCtrlC { + logger.Info("caught Ctrl+C via tcell event") + go func() { + if err := pwShutDown(); err != nil { + logger.Error("shutdown failed", "err", err) + } + app.Stop() + }() + return nil // swallow the event + } if event.Key() == tcell.KeyCtrlG { // cfg.RAGDir is the directory with files to use with RAG // rag load -- cgit v1.2.3