From c65ec47d6c16d49f6a1661638c6cb6f2a38a3fb2 Mon Sep 17 00:00:00 2001 From: Gustave-241021 <2909789120@qq.com> Date: Mon, 8 Dec 2025 22:39:17 +0800 Subject: [PATCH] fix:prevent crash when pressing ctrl+f on model selector (#1573) --- internal/tui/page/chat/chat.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/tui/page/chat/chat.go b/internal/tui/page/chat/chat.go index 1d638a6f8b5fef587256d1b9a7d8e6fd805a787e..a5cb757d7d4403b8b99c82f5941065037bf86c71 100644 --- a/internal/tui/page/chat/chat.go +++ b/internal/tui/page/chat/chat.go @@ -379,8 +379,17 @@ func (p *chatPage) Update(msg tea.Msg) (util.Model, tea.Cmd) { } return p, p.newSession() case key.Matches(msg, p.keyMap.AddAttachment): + // Skip attachment handling during onboarding/splash screen + if p.focusedPane == PanelTypeSplash || p.isOnboarding { + u, cmd := p.splash.Update(msg) + p.splash = u.(splash.Splash) + return p, cmd + } agentCfg := config.Get().Agents[config.AgentCoder] model := config.Get().GetModelByType(agentCfg.Model) + if model == nil { + return p, util.ReportWarn("No model configured yet") + } if model.SupportsImages { return p, util.CmdHandler(commands.OpenFilePickerMsg{}) } else {