aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-17 14:13:44 +0200
committeruser <user@clank>2026-08-17 14:13:44 +0200
commite2eac8ef074d15cbff4844b956ddbe1031200dc8 (patch)
treebb7eef6e3f543e38ced30675b350e22e50b03001 /docs
parentsl0ppty: a wrapped line is one line when you copy it (diff)
downloadslosh-e2eac8ef074d15cbff4844b956ddbe1031200dc8.tar.gz
slosh-e2eac8ef074d15cbff4844b956ddbe1031200dc8.tar.xz
slosh-e2eac8ef074d15cbff4844b956ddbe1031200dc8.zip
sl0ppty: a dead pane says what it ran
``` │help: find a package to install `watch` with `cargo search cargo-watch` │ │ │ │[ran: cargo watch -x test] │ │[process exited: status 101] │ ╰ exited: status 101 ─────────────────────────────────[re-run]─[close]─╯ ``` `[re-run]` is one button on a pane whose program is gone, and nothing on the pane said what it would run. The command was never anywhere: not in the frame, not in the backlog, not in the exit note. Worst in a tab a project's layout built, where the command was never typed into that pane and so cannot be scrolled back to either -- which is now the common case, since that is what `open-workspace` does. So the death note gains a line above it. A pane running the session's shell has no command to name and gets the exit line alone, as before: `[ran: /bin/sh]` would be noise dressed as information. One note rather than two calls. `pane_note` puts a blank line either side of what it writes, so two of them would space the two halves apart as if they were about different things, when they are two facts about one run. Re-running keeps the previous run above it (D14), so the pair turns a pane you re-run into a log of what ran rather than a pile of identical epitaphs. Not put in the frame footer, which is the other place the question gets asked. It already carries the exit words and competes with the buttons for width, so a long command would arrive truncated in the one place that is always visible -- and the note is on screen anyway in the case that matters, because a pane whose program just exited is scrolled to the bottom. **Three existing tests were counting a string that now appears twice.** `DIES_CMD` is `echo mark-one; exit 3`, and they waited for `screen().count("mark-one") == 2` to mean "it ran twice" -- but the note contains the command, so every run now matches twice and the wait never finished. They ask `output_runs()` instead, which counts lines holding the marker that are not the `[ran:` line. Per line rather than by trimming the text, because every row still has the pane's frame border on the end of it. That is a fair correction and not a weakening: the assertion is still "the output appeared twice", which is what they meant. Verified: 56 checks in `tests/test_dead.py`, 1801 overall, all green. Three new: the command is named and sits *above* the exit line (asserted by row order, not by reading the two strings out of one screen); a pane with no command names none; and two runs produce two of each note. Then a real session, `command="cargo watch -x test"` with cargo-watch not installed, which is how this was noticed.
Diffstat (limited to 'docs')
-rw-r--r--docs/panes.md19
1 files changed, 14 insertions, 5 deletions
diff --git a/docs/panes.md b/docs/panes.md
index fd3bcee..162356b 100644
--- a/docs/panes.md
+++ b/docs/panes.md
@@ -87,16 +87,25 @@ project you have not opened yet has no pane for the finder to match.
Split off a shell, do something, type `exit`: it closes, like a terminal should.
But a pane that was *told to run something* — from a [layout](layouts.md) or the
[control API](scripting.md) — keeps what it printed when that something exits,
-with a line saying how it ended and two buttons:
+with two lines saying what ran and how it ended, and two buttons:
```
+ [ran: npm run dev]
+ [process exited: status 3]
╰ exited: status 3 ───────────────────────────────[re-run]─[close]─╯
```
-`[re-run]` (or `C-a r`) runs the same command again in the same pane, keeping
-the previous run above it in the scrollback. So a command that failed while you
-were looking elsewhere still has its error message when you get back, and a
-mistyped command in a fresh session no longer closes the session.
+**The command is written down because `[re-run]` is one button.** Without it,
+pressing it is a guess — most of all in a tab that a [project's
+layout](workspaces.md) built, where the command was never typed into that pane to
+be scrolled back to. A pane running the session's shell has no command to name
+and gets the exit line alone.
+
+`[re-run]` (or `C-a r`) runs the same command again in the same pane, keeping the
+previous run above it in the scrollback. So the two notes turn a pane you re-run
+into a log of what ran rather than a pile of identical epitaphs — and a command
+that failed while you were looking elsewhere still has its error message when you
+get back, while a mistyped command in a fresh session no longer closes it.
Which panes stay is one setting, `keep_dead`: `commands` (the default), `all`,
or `none`.