mirror of
https://github.com/skoelle/kctl-tui.git
synced 2026-09-18 04:20:25 +00:00
Fix tmux: add -- separator for shell commands, kill stale sessions
This commit is contained in:
@@ -89,11 +89,12 @@ not cover: **redeploy** and **secrets diff**.
|
|||||||
Example startup command (generic placeholders):
|
Example startup command (generic placeholders):
|
||||||
|
|
||||||
```
|
```
|
||||||
|
tmux kill-session -t kctl \; \
|
||||||
tmux new-session -d -s kctl \
|
tmux new-session -d -s kctl \
|
||||||
"kctl-tui panel --context=$CTX_A --ns=$NS --team=$TEAM" \; \
|
-- "kctl-tui panel --context=$CTX_A --ns=$NS --team=$TEAM" \; \
|
||||||
set-option -t kctl remain-on-exit on \; \
|
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.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.1 -- "k9s --context $CTX_B -n $NS" \; \
|
||||||
select-layout -t kctl even-vertical \; \
|
select-layout -t kctl even-vertical \; \
|
||||||
select-pane -t kctl:0.0 \; \
|
select-pane -t kctl:0.0 \; \
|
||||||
attach -t kctl
|
attach -t kctl
|
||||||
|
|||||||
@@ -278,17 +278,18 @@ func (m *fullModel) startTmuxSession() tea.Cmd {
|
|||||||
k9sCmdA := fmt.Sprintf("k9s --context %s -n %s", ctxA, m.selectedNamespace)
|
k9sCmdA := fmt.Sprintf("k9s --context %s -n %s", ctxA, m.selectedNamespace)
|
||||||
|
|
||||||
args := []string{
|
args := []string{
|
||||||
|
"kill-session", "-t", "kctl", ";", // ignore error if no session exists
|
||||||
"new-session", "-d", "-s", "kctl",
|
"new-session", "-d", "-s", "kctl",
|
||||||
panelCmd, ";",
|
"--", panelCmd, ";",
|
||||||
"set-option", "-t", "kctl", "remain-on-exit", "on", ";",
|
"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 {
|
if len(m.cfg.Envs) > 1 {
|
||||||
envB := m.cfg.Envs[1]
|
envB := m.cfg.Envs[1]
|
||||||
ctxB := m.cfg.ResolveContext(envB, m.selectedContext)
|
ctxB := m.cfg.ResolveContext(envB, m.selectedContext)
|
||||||
k9sCmdB := fmt.Sprintf("k9s --context %s -n %s", ctxB, m.selectedNamespace)
|
k9sCmdB := fmt.Sprintf("k9s --context %s -n %s", ctxB, m.selectedNamespace)
|
||||||
args = append(args,
|
args = append(args,
|
||||||
"split-window", "-v", "-t", "kctl:0.1", k9sCmdB, ";",
|
"split-window", "-v", "-t", "kctl:0.1", "--", k9sCmdB, ";",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
args = append(args,
|
args = append(args,
|
||||||
|
|||||||
Reference in New Issue
Block a user