From 91cac5e97979078e23fead74787b88c8c015eedd Mon Sep 17 00:00:00 2001 From: tyzbit <3319104+tyzbit@users.noreply.github.com> Date: Sun, 21 May 2023 11:06:37 -0400 Subject: [PATCH] fix: (config) only respect the --command flag once (#2096) We want to switch to the command specified by the flag, but only at startup. Afterwards, we should be interactive and favor the user's command choices over the startup commandline switch. --- internal/config/config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index d6ed48f6..3a10544c 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -191,6 +191,10 @@ func (c *Config) ActiveView() string { cmd := cl.View.Active if c.K9s.manualCommand != nil && *c.K9s.manualCommand != "" { cmd = *c.K9s.manualCommand + // We reset the manualCommand property because + // the command-line switch should only be considered once, + // on startup. + *c.K9s.manualCommand = "" } return cmd