Rename Kill to Close, add New Terminal palette entry, clean up exited terminals

- Palette's per-child "Kill <name>" action is now labelled "Close <name>"
  (action kind unchanged; still SIGTERM). Matches the existing "Close
  agent: …" context entry and reads less violent for a graceful term.
- New "New Terminal" palette entry spawns a bare interactive $SHELL pane
  via LaunchTerminal (kind=terminal). Replaces the default "shell"
  process preset that was seeded on first run.
- Exited KindTerminal entries are now dropped from the session in
  reapChild — terminals have no restart path, so leaving them behind as
  greyed rows in the Processes sidebar was just clutter. processList
  also filters defensively.
This commit is contained in:
2026-05-15 01:07:57 +01:00
parent 9d0168f139
commit 6ee6f6d867
7 changed files with 74 additions and 35 deletions

View File

@@ -11,12 +11,13 @@ import (
// paletteAction is what the palette returns when the user picks an item.
type paletteAction struct {
// kind: "spawn-agent" | "spawn-process" | "spawn-process-form" |
// "spawn-process-submit" | "switch" | "kill" | "quit" |
// "cancel" | "pad-delete" | "pad-rename" | "pad-rename-form" |
// "pad-rename-submit" | "pad-edit" | "agent-rename" |
// "agent-rename-form" | "agent-rename-submit" | "agent-close" |
// "proc-rename" | "proc-rename-form" | "proc-rename-submit" |
// "proc-delete" | "proc-stop" | "proc-restart"
// "spawn-process-submit" | "spawn-terminal" | "switch" |
// "kill" | "quit" | "cancel" | "pad-delete" | "pad-rename" |
// "pad-rename-form" | "pad-rename-submit" | "pad-edit" |
// "agent-rename" | "agent-rename-form" | "agent-rename-submit" |
// "agent-close" | "proc-rename" | "proc-rename-form" |
// "proc-rename-submit" | "proc-delete" | "proc-stop" |
// "proc-restart"
kind string
// For spawn-agent / spawn-process, the preset to launch.
@@ -276,6 +277,16 @@ func (p *paletteState) allItems() []paletteItem {
})
}
// "New Terminal" — bare interactive $SHELL pane. Distinct from
// "Run process: …" presets in that it spawns a KindTerminal (which
// disappears from the sidebar on exit rather than sticking around
// for restart). One quick keystroke; no form.
out = append(out, paletteItem{
label: "New Terminal",
hint: "bare interactive $SHELL · removed on exit",
action: paletteAction{kind: "spawn-terminal"},
})
// Freeform "Spawn process…" entry. Opens a sub-form for typing an
// arbitrary command line and ticking "relaunch on exit". The action
// kind is intercepted by acceptOrEnterForm so accept switches the
@@ -288,14 +299,14 @@ func (p *paletteState) allItems() []paletteItem {
action: paletteAction{kind: "spawn-process-form"},
})
// Kill entries last among the action rows, before Quit. Mirror the
// Close entries last among the action rows, before Quit. Mirror the
// "(current)" marker from switch entries so the focused tab is
// obvious when scanning the kill list.
// obvious when scanning the close list.
for _, c := range p.children {
if c.Status() != StatusRunning {
continue
}
label := "Kill " + c.DisplayName()
label := "Close " + c.DisplayName()
if c.ID == p.focused {
label = "• " + label + " (current)"
}