aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorsl0p <sl0p@sl0p.foo>2026-08-13 23:50:24 +0200
committersl0p <sl0p@sl0p.foo>2026-08-13 23:50:24 +0200
commitb514f68d9535e0ee882eecbbac217486f999f538 (patch)
tree1175f74690a61080a8b2d9339335f8b42ef52f05 /config
parentsl0ptty: focus follows the mouse, with the guards that make it liveable (diff)
downloadslosh-b514f68d9535e0ee882eecbbac217486f999f538.tar.gz
slosh-b514f68d9535e0ee882eecbbac217486f999f538.tar.xz
slosh-b514f68d9535e0ee882eecbbac217486f999f538.zip
sl0ptty: scrollback — wheel, keyboard, and a clickable indicator
libghostty-vt already keeps the scrollback, so the work was deciding whose wheel it is: - a program tracking the mouse gets the wheel events themselves; - a full-screen program without mouse tracking (vim, less) has no scrollback of ours to show, so the wheel becomes arrow keys, which is what it means to that program; - anything else scrolls our viewport. All three are tested against real programs rather than asserted in principle. C-a PageUp/PageDown/Home/End, and scroll_lines in the config for the wheel. Typing snaps back to the live view, because reading scrollback and then typing into a screen you are not looking at is a trap. New output does not yank the viewport back — it just grows the gap, which the indicator shows. The indicator is compact, right-aligned, budgeted after the split button and before the title (a title is the thing you can most afford to lose), and clicking it returns to the bottom. Three test failures on the way, all mine and all instructive: the top of the scrollback is the shell's first prompt rather than the first line of output; typing without a newline types rather than runs; and two side-by-side panes share a screen row, so asserting on line(y) reads both frames at once. 341 checks green.
Diffstat (limited to 'config')
-rw-r--r--config/config.kdl14
1 files changed, 13 insertions, 1 deletions
diff --git a/config/config.kdl b/config/config.kdl
index 82a8c77..ef9367f 100644
--- a/config/config.kdl
+++ b/config/config.kdl
@@ -38,6 +38,9 @@ focus_follows_mouse true
// widening the terminal always restores exactly the layout you had.
min_pane cols=24 rows=6
+// Rows per wheel notch, and per scroll-up/scroll-down.
+scroll_lines 3
+
// What a new pane runs. Unset means $SHELL.
// shell "/bin/bash"
@@ -61,7 +64,8 @@ theme {
//
// Actions: split-cols split-rows close-pane focus-left focus-right focus-up
// focus-down focus-next resize-left resize-right resize-up resize-down
-// new-tab next-tab prev-tab select-tab-1..9 finder detach quit
+// scroll-up scroll-down scroll-page-up scroll-page-down scroll-top
+// scroll-bottom new-tab next-tab prev-tab select-tab-1..9 finder detach quit
// literal-prefix none
keys {
@@ -96,6 +100,14 @@ keys {
bind "3" "select-tab-3"
bind "f" "finder"
+
+ // Scrollback. The wheel does this too, unless the program in the pane
+ // wants the mouse itself, or is a full-screen program with no scrollback
+ // of ours to show — then the wheel means arrow keys to it.
+ bind "pageup" "scroll-page-up"
+ bind "pagedown" "scroll-page-down"
+ bind "home" "scroll-top"
+ bind "end" "scroll-bottom"
bind "d" "detach"
bind "q" "quit"
}