From c67093807b3c5fc7ce3f02640b16a2186f969b4f Mon Sep 17 00:00:00 2001 From: Yarek T Date: Sat, 5 Aug 2023 15:43:27 +0100 Subject: [PATCH] Focus command bar if active on startup (#2179) If the command bar was activated with `:` before or during the splash delay, the main page would steal focus from it, breaking the UI. This patch re-focuses the command bar if its active after switching focus to the main page. Fixes issue #2178 --- internal/view/app.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/view/app.go b/internal/view/app.go index 9840f87c93..7c99521aa4 100644 --- a/internal/view/app.go +++ b/internal/view/app.go @@ -466,6 +466,10 @@ func (a *App) Run() error { <-time.After(splashDelay) a.QueueUpdateDraw(func() { a.Main.SwitchToPage("main") + // if command bar is already active, focus it + if a.CmdBuff().IsActive() { + a.SetFocus(a.Prompt()) + } }) }()