diff options
| author | user <user@clank> | 2026-08-15 16:13:46 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-15 16:13:46 +0200 |
| commit | ee6288a7eadeb43c83a5ab78f6c65cffa4748a53 (patch) | |
| tree | 8fc137687f47a7f20f0a2766bca17cd53e0400dc /src/app.h | |
| parent | make coverage: a number, cheaply (diff) | |
| download | slosh-ee6288a7eadeb43c83a5ab78f6c65cffa4748a53.tar.gz slosh-ee6288a7eadeb43c83a5ab78f6c65cffa4748a53.tar.xz slosh-ee6288a7eadeb43c83a5ab78f6c65cffa4748a53.zip | |
sl0ppty: C-a e opens the config, in a pane, in your editor
The config watcher's whole point is the loop -- edit, save, watch the session
change under you, edit again -- and the loop had a hole in the middle of it:
you had to leave the session, or remember where the file lives, to start.
So: one keystroke opens `$EDITOR <config>` in a new pane, down rather than
across because a config file is lines and half the height beats half the
width for reading them. `editor` in the config beats $EDITOR, and vi is the
fallback, being the one editor a POSIX system must have -- a wrong guess you
can see and change beats a pane that opens empty.
The interesting part is what kind of pane it is. Panes given a command keep
their corpse (D14), which is right for a dev server and wrong for this: quit
the editor and you would be left dismissing a dead pane you opened thirty
seconds ago. Rather than gaming that policy by giving the pane no command --
which would be a lie in the one field dump-layout and re-run read -- panes can
now be *ephemeral*: a task rather than part of the session's shape. An
ephemeral pane keeps no corpse and is not written into a dumped layout, so a
restart does not reopen somebody's editor on a file they had finished with.
That concept is the reusable half of this commit; the keybinding is the part
you notice.
Diffstat (limited to 'src/app.h')
| -rw-r--r-- | src/app.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -114,6 +114,9 @@ bool app_close_pane(app_t *a, uint32_t id); /* Run a dead (or not-yet-started) pane's command again, in the same pane and * on top of the same scrollback. 0 means the focused one. */ bool app_rerun_pane(app_t *a, uint32_t id); +/* Open the config file in $EDITOR, in a pane of its own, so the edit/save/ + * watch loop happens without leaving the session. The pane is ephemeral. */ +bool app_edit_config(app_t *a); uint32_t app_focused_pane_id(app_t *a); uint32_t app_current_tab_id(app_t *a); |
