Fix: graceful shutdown in tui, to avoid other key block

This commit is contained in:
Grail Finder
2026-03-04 08:29:47 +03:00
parent 58ccd63f4a
commit 50ce0200af
2 changed files with 11 additions and 14 deletions

11
tui.go
View File

@@ -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