Compare commits

..
2 Commits
Author SHA1 Message Date
stefankoelle fb4c1be12b release v0.3.5
Disable Quit option in Windows Terminal mode.

- Hide 'Quit (closes this tmux session)' in env menu when using wt mode — prevents confusion as wt windows are independent
- Esc on env menu stays on env menu in wt mode (no tmux kill attempted)
2026-09-16 22:46:26 +02:00
stefankoelle 9e3fefb71a feat: disable Quit option in Windows Terminal mode
- Hide 'Quit (closes this tmux session)' in env menu when using wt mode
- Esc on env menu stays on env menu in wt mode (no tmux kill attempted)
2026-09-16 22:41:34 +02:00
+14 -2
View File
@@ -8,6 +8,7 @@ import (
"flag"
"fmt"
"os/exec"
"runtime"
"strconv"
"strings"
"time"
@@ -61,6 +62,11 @@ type panelModel struct {
err error
}
// isWtMode returns true when running on Windows with multiplexer: "wt".
func (m *panelModel) isWtMode() bool {
return runtime.GOOS == "windows" && m.cfg.MultiplexerBackend() == "wt"
}
func runPanel(args []string) error {
fs := flag.NewFlagSet("panel", flag.ContinueOnError)
context := fs.String("context", "", "context (e.g. internal/external)")
@@ -99,7 +105,9 @@ func newPanelModel(context, ns, team string) *panelModel {
func (m *panelModel) showEnvMenu() {
items := make([]list.Item, 0, len(m.cfg.Envs)+1)
items = append(items, simpleItem{label: "Quit (closes this tmux session)", value: "quit"})
if !m.isWtMode() {
items = append(items, simpleItem{label: "Quit (closes this tmux session)", value: "quit"})
}
for _, env := range m.cfg.Envs {
items = append(items, simpleItem{label: env, value: env})
}
@@ -179,10 +187,14 @@ func (m *panelModel) usesTextInput() bool {
// handleEsc navigates one level up: action menu -> env menu, most
// sub-steps -> action menu. From the top-level env menu it closes the
// whole tmux session (all panes, including the two k9s status panes)
// before quitting this program, per SPEC.md 3.6.
// before quitting this program, per SPEC.md 3.6. In wt mode, Esc on
// the env menu does nothing — the user closes the wt window manually.
func (m *panelModel) handleEsc() (tea.Model, tea.Cmd) {
switch m.step {
case stepEnvMenu:
if m.isWtMode() {
return m, nil
}
exec.Command("tmux", "kill-session", "-t", "kctl").Run()
return m, tea.Quit
case stepActionMenu: