aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-16 19:25:52 +0200
committeruser <user@clank>2026-08-16 19:25:52 +0200
commit503b309187eaf0bc7282dd09e93c695dba11abb5 (patch)
tree420112d1b9ea8416375b7f0cd0b4777ee8137599 /config
parentsl0ppty: a pane can change tabs (diff)
downloadslosh-503b309187eaf0bc7282dd09e93c695dba11abb5.tar.gz
slosh-503b309187eaf0bc7282dd09e93c695dba11abb5.tar.xz
slosh-503b309187eaf0bc7282dd09e93c695dba11abb5.zip
sl0ppty: `C-a >` sends this pane to the next tab
C-a > push it to the tab after C-a b into a tab of its own C-a < push it to the tab before Three actions rather than three special cases in the key handler, which is what puts them in the cheatsheet and the palette without another line of code -- and the palette is where you find a thing you did not know to look for. You do not follow the pane, and a toast says where it went: "moved to tab 2 (api)". A key you might press twice needs to say what it did, and following would take you away from what you were doing. The tab's *name* is read before the move and its *number* after: emptying this tab removes it and shifts everything along, so the number read first is not the number anybody will see. When the tab you were in is the one that goes, you arrive in the survivor because there is nowhere to stay. `>` and `<` are the shifted period and comma, and the defaults bind both halves -- a terminal does not report shift for punctuation, so `>` arrives as a bare period the way `?` arrives as a bare slash. The config loader already did this for a chord you write by hand; the defaults had to do it themselves. The cost is that `.` and `,` are spoken for, which is the cost `/` already pays for `?`. `b` is for break out, the word tmux taught everybody for this. **Two things the tests caught, both mine.** `panes` reported a pane's tab as an index while every command that takes a tab wants an id -- and my own test conflated them, passing only because the two agree until a tab is removed, which is half of what these keys do. There is now a `tab_id` beside the `tab`: one is where it sits in the strip, the other is what you pass back. And three more rows overflowed the cheatsheet: `modal_frame` clamps the box to the screen, so at 56x44 the `session` group was simply not drawn. The sheet now says `+7 more, in docs/keys.md` when it cannot show everything -- counted by walking the rows it skipped, because arithmetic on two uneven columns claimed six were hidden on a screen showing all of them. A list that quietly stops is worse than a short one: the reader cannot tell that the key they wanted was on it. Reflowing to two columns when the height forces it would be better than a footnote, and is not this commit. Verified: `tests/test_move_pane.py` at 38 checks -- the keys in both directions, breaking out, the refusal when there is only one tab, pushing the last pane out and landing in the survivor, and that the sheet prints `>` rather than the bare period it also answers to while the palette finds it by label. `tests/test_help.py` gained the short-terminal case and lost an assumption about its own fixture height.
Diffstat (limited to 'config')
-rw-r--r--config/config.kdl9
1 files changed, 8 insertions, 1 deletions
diff --git a/config/config.kdl b/config/config.kdl
index 9ee458a..afacd47 100644
--- a/config/config.kdl
+++ b/config/config.kdl
@@ -703,7 +703,7 @@ 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 equalize
-// rotate-layout clear-shaders
+// rotate-layout clear-shaders pane-to-next-tab pane-to-prev-tab pane-to-new-tab
// scroll-up scroll-down scroll-page-up scroll-page-down scroll-top
// scroll-bottom zoom minimize rerun new-tab next-tab prev-tab select-tab-1..9 finder
// palette help detach quit
@@ -770,6 +770,13 @@ keys {
// usually fixes that.
bind "space" "rotate-layout"
+ // Push the focused pane one tab along, or out into a tab of its own. `>` and
+ // `<` are the shifted period and comma; a terminal does not report the shift
+ // for punctuation, so `.` and `,` answer to them too -- the same deal `/`
+ // already has with `?`.
+ bind ">" "pane-to-next-tab"
+ bind "<" "pane-to-prev-tab"
+ bind "b" "pane-to-new-tab"
bind "c" "new-tab"
// Tab cycles tabs, the way every other tabbed thing does. `n` and `p`
// used to, and are free again: `p` is worth more as the palette, which is