mirror of
https://github.com/skoelle/kctl-tui.git
synced 2026-09-17 20:10:24 +00:00
Fix tmux: add -- separator for shell commands, kill stale sessions
This commit is contained in:
@@ -278,17 +278,18 @@ func (m *fullModel) startTmuxSession() tea.Cmd {
|
||||
k9sCmdA := fmt.Sprintf("k9s --context %s -n %s", ctxA, m.selectedNamespace)
|
||||
|
||||
args := []string{
|
||||
"kill-session", "-t", "kctl", ";", // ignore error if no session exists
|
||||
"new-session", "-d", "-s", "kctl",
|
||||
panelCmd, ";",
|
||||
"--", panelCmd, ";",
|
||||
"set-option", "-t", "kctl", "remain-on-exit", "on", ";",
|
||||
"split-window", "-v", "-t", "kctl:0.0", k9sCmdA, ";",
|
||||
"split-window", "-v", "-t", "kctl:0.0", "--", 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 -n %s", ctxB, m.selectedNamespace)
|
||||
args = append(args,
|
||||
"split-window", "-v", "-t", "kctl:0.1", k9sCmdB, ";",
|
||||
"split-window", "-v", "-t", "kctl:0.1", "--", k9sCmdB, ";",
|
||||
)
|
||||
}
|
||||
args = append(args,
|
||||
|
||||
Reference in New Issue
Block a user