From d32ccd59528b8c3444940621ff5d57cf1b26323a Mon Sep 17 00:00:00 2001 From: Stefan Koelle Date: Wed, 16 Sep 2026 21:44:23 +0200 Subject: [PATCH] fix: avoid confusing tmux message in wt mode Use c.Start() instead of tea.ExecProcess in startWtSession() to prevent tmux session closed message from appearing in the main window. --- cmd/kctl-tui/full.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/kctl-tui/full.go b/cmd/kctl-tui/full.go index a5e2cbb..3d5334d 100644 --- a/cmd/kctl-tui/full.go +++ b/cmd/kctl-tui/full.go @@ -335,6 +335,8 @@ func (m *fullModel) startTmuxSessionTmux() tea.Cmd { // startWtSession creates the session using Windows Terminal's native // split-pane feature. This avoids the psmux focus-freeze issue on Windows. +// Note: In Windows Terminal, -H (horizontal) stacks panes top/bottom, +// while -V (vertical) places them side by side — opposite of tmux. func (m *fullModel) startWtSession() tea.Cmd { selfPath, err := os.Executable() if err != nil { @@ -351,20 +353,19 @@ func (m *fullModel) startWtSession() tea.Cmd { kubeexec.VerboseLog("[debug] panelCmd=%s\n", panelCmd) kubeexec.VerboseLog("[debug] k9sCmdA=%s\n", k9sCmdA) - args := []string{"new-tab", panelCmd, ";", "split-pane", "-V", k9sCmdA} + wtCmd := fmt.Sprintf("wt new-tab %s ; split-pane -H %s", panelCmd, k9sCmdA) if len(m.cfg.Envs) > 1 { envB := m.cfg.Envs[1] ctxB := m.cfg.ResolveContext(envB, m.selectedContext) k9sCmdB := fmt.Sprintf("k9s --context %s --namespace %s --command pods", ctxB, m.selectedNamespace) kubeexec.VerboseLog("[debug] k9sCmdB=%s\n", k9sCmdB) - args = append(args, ";", "split-pane", "-V", k9sCmdB) + wtCmd += fmt.Sprintf(" ; split-pane -H %s", k9sCmdB) } - c := exec.Command("wt", args...) - return tea.ExecProcess(c, func(err error) tea.Msg { - return tmuxDoneMsg{err: err} - }) + c := exec.Command("cmd", "/c", wtCmd) + _ = c.Start() + return nil } func (m *fullModel) View() string {