diff options
| author | user <user@clank> | 2026-08-14 12:14:17 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-14 12:14:17 +0200 |
| commit | 1ceafa4d82bdc37449c174a75fcd38b4be880080 (patch) | |
| tree | 33c2904620ac1e5477eb1b8d387bff00ba3f2157 /config | |
| parent | sl0ppty: one-shot --headless printed a blank screen (diff) | |
| download | slosh-1ceafa4d82bdc37449c174a75fcd38b4be880080.tar.gz slosh-1ceafa4d82bdc37449c174a75fcd38b4be880080.tar.xz slosh-1ceafa4d82bdc37449c174a75fcd38b4be880080.zip | |
sl0ppty: the pane title is a name — double-click it to rename
The top row was both the frame's drag handle and its top edge: resting on it
armed the split guide, and a click that never moved split upward. That is
right for a border and wrong for the cells the title sits on, because it left
no gesture free for naming a pane — a double-click there split twice.
So the title text carves its own hit region out of the top row. It is
registered after the row's handle and after the title is painted, which is
what makes it correct: hit_test scans backwards, so the region that wins is
the one whose glyphs the user can actually see, and its width comes from
screen_text's return so a title of wide characters claims the cells it drew.
Resting there arms nothing (draw_split_guide matches "title:" exactly), and a
press takes no side, so the click-splits path — now guarded on a side being
set — does nothing. Dragging still moves the pane: that reads as grabbing it
by its name. Everything else on the top row still splits upward.
Renaming happens in the title cell itself. There is no dialog to place,
nothing to dismiss, and the pane it belongs to cannot be in doubt. It is the
finder's shape: state on app_t, a key handler that owns the keyboard while it
is open, drawn by the pass that draws the frame. Enter keeps the name, Escape
abandons it, clicking away keeps it the way leaving a field does.
A typed name shadows the program's title rather than overwriting it. The
program's OSC 2 keeps arriving underneath, so a shell that rewrites its title
cannot undo a rename, and clearing the name gives the pane back to what the
program calls itself *now* rather than to whatever it happened to say when the
rename began. That is the whole reason pane_t grew a second string instead of
a flag.
Backspace deletes a character rather than a byte — a title is whatever a
program could set, and half a UTF-8 sequence is not a name — and a name too
long for the frame scrolls its head off, because the caret is the one thing
that has to stay visible. double_click_ms (400) joins hover_delay_ms in the
config.
The tests keep a control beside each behaviour, since most of these could pass
by breaking something else: two slow clicks must open no editor, the top edge
must still split, keystrokes must not reach the shell, and a pane closing
mid-rename must give the keyboard back.
Diffstat (limited to 'config')
| -rw-r--r-- | config/config.kdl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/config/config.kdl b/config/config.kdl index b211475..248839c 100644 --- a/config/config.kdl +++ b/config/config.kdl @@ -46,6 +46,12 @@ scroll_lines 3 // somewhere else should not make the screen flash. 0 arms immediately. hover_delay_ms 250 +// How close together two clicks on a pane's title must be to count as a +// double-click, which renames that pane in place. Enter keeps the new name, +// Escape abandons it, and an empty name gives the pane back to whatever its +// program calls itself. +double_click_ms 400 + // How long an announcement ("copied 13 chars", a pane's OSC 9 notification, // "config reloaded") stays in the bottom-right corner. toast_ms 2500 |
