From 201168e8cde417da851a94216b21ba03aba7411e Mon Sep 17 00:00:00 2001 From: Stefan Koelle Date: Sun, 9 Aug 2026 21:57:24 +0200 Subject: [PATCH] Fix k9s on Windows: --namespace, --command pods - -n flag not supported on Windows k9s, use --namespace instead - Start k9s directly in pods view with --command pods --- SPEC.md | 8 ++++---- cmd/kctl-tui/full.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SPEC.md b/SPEC.md index b61be96..577f95a 100644 --- a/SPEC.md +++ b/SPEC.md @@ -75,9 +75,9 @@ Once start navigation is complete, the tool opens a tmux session with | -> runs the kctl-tui binary in "panel" mode | | -> menu: Redeploy, secrets diff | +--------------------------------------------------+ -| Pane 1 (middle): k9s --context -n | +| Pane 1 (middle): k9s --context --namespace --command pods| +--------------------------------------------------+ -| Pane 2 (bottom): k9s --context -n | +| Pane 2 (bottom): k9s --context --namespace --command pods| +--------------------------------------------------+ ``` @@ -94,8 +94,8 @@ tmux kill-session -t kctl tmux new-session -d -s kctl \ "kctl-tui panel --context=$CTX_A --ns=$NS --team=$TEAM" \; \ set-option -t kctl remain-on-exit on \; \ - split-window -v -t kctl:0.0 "k9s --context $CTX_A -n $NS" \; \ - split-window -v -t kctl:0.1 "k9s --context $CTX_B -n $NS" \; \ + split-window -v -t kctl:0.0 "k9s --context $CTX_A --namespace $NS --command pods" \; \ + split-window -v -t kctl:0.1 "k9s --context $CTX_B --namespace $NS --command pods" \; \ select-layout -t kctl even-vertical \; \ select-pane -t kctl:0.0 \; \ attach -t kctl diff --git a/cmd/kctl-tui/full.go b/cmd/kctl-tui/full.go index 481d47d..a6d0bff 100644 --- a/cmd/kctl-tui/full.go +++ b/cmd/kctl-tui/full.go @@ -278,7 +278,7 @@ func (m *fullModel) startTmuxSession() tea.Cmd { envA := m.cfg.Envs[0] ctxA := m.cfg.ResolveContext(envA, m.selectedContext) - k9sCmdA := fmt.Sprintf("k9s --context %s -n %s", ctxA, m.selectedNamespace) + k9sCmdA := fmt.Sprintf("k9s --context %s --namespace %s --command pods", ctxA, m.selectedNamespace) kubeexec.VerboseLog("[debug] selfPath=%s\n", selfPath) kubeexec.VerboseLog("[debug] panelCmd=%s\n", panelCmd) @@ -297,7 +297,7 @@ func (m *fullModel) startTmuxSession() tea.Cmd { if len(m.cfg.Envs) > 1 { envB := m.cfg.Envs[1] ctxB := m.cfg.ResolveContext(envB, m.selectedContext) - k9sCmdB := fmt.Sprintf("k9s --context %s -n %s", ctxB, m.selectedNamespace) + k9sCmdB := fmt.Sprintf("k9s --context %s --namespace %s --command pods", ctxB, m.selectedNamespace) kubeexec.VerboseLog("[debug] k9sCmdB=%s\n", k9sCmdB) setup = append(setup, []string{"split-window", "-v", "-t", "kctl:0.1", k9sCmdB}) }