aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authoruser <user@clank>2026-10-09 12:24:23 +0200
committeruser <user@clank>2026-10-09 12:31:53 +0200
commit3a0825c6890eff566307c0eaad809cdbcf854efd (patch)
treeadd5cc5d6e731bce8dcffe96fa92d64c84052143 /docs
parentpanes: the focus a closed tab left behind (diff)
downloadslosh-3a0825c6890eff566307c0eaad809cdbcf854efd.tar.gz
slosh-3a0825c6890eff566307c0eaad809cdbcf854efd.tar.xz
slosh-3a0825c6890eff566307c0eaad809cdbcf854efd.zip
tab bar: a sidebar that fits the terminal, and gives up the edge last
`tab_bar_width` was a reservation: the configured columns came off the screen whatever the screen was, and the only fallback was all the way back to the top row. On a narrow terminal that is chrome displacing the thing it is chrome for, and the jump to the top moves every target you were aiming at. It is a ceiling now. app_tab_bar_cols takes the app, because the answer depends on the terminal and not only on the config: held to the columns left after a pane's collapse width, and to a third of the screen, and narrowed rather than dropped. TAB_BAR_FIT (14) is the narrowest width this code will invent on its own -- a config that asks for less is taken at its word -- and 0 means there is no room for a sidebar at all, which is the one case that still falls back on top. Height counts too, which it did not before: a sidebar spends a row per tab, so a wide but short terminal runs out of list before it runs out of screen, and a tab with no row is not clipped, it is unreachable. tab_bar_min_rows is that floor. Not when the top strip could not seat them either -- moving them would gain nothing, so the side you configured stands. All of it is re-derived per frame, like the layout, so a resize moves the bar and nothing remembers that it did. test_tab_bar also stops depending on where the suite is run from. An unnamed tab borrows the basename of its focused pane's cwd, so eight checks read `tests` under `make test` (which cds there) and `slosh` from the repository root, where they failed. They are about padding, alignment and the index, not about that derivation, so they name the tab first -- by id, since `set-name` takes 0 for the focused *pane* only. 147 checks, green from either directory.
Diffstat (limited to 'docs')
-rw-r--r--docs/panes.md22
-rw-r--r--docs/slosh.514
2 files changed, 29 insertions, 7 deletions
diff --git a/docs/panes.md b/docs/panes.md
index 57e3014..6a4b586 100644
--- a/docs/panes.md
+++ b/docs/panes.md
@@ -54,7 +54,7 @@ The strip of tabs sits along the top by default. It does not have to:
```kdl
tab_bar_side "left" // or "right"; "top" is the default
-tab_bar_width 18 // columns the sidebar takes
+tab_bar_width 18 // columns the sidebar takes, at most
tab_bar_index "right" // the tab number at the far end; "prefix" is 1:name
tab_bar_padding 0 1 0 2 // air inside it, in cells: top right bottom left
tab_bar_pad 0 // ...or just the top of that, the older name
@@ -78,8 +78,24 @@ the strip runs out of room. Set `newtab_button false` to drop the button
altogether; `new-tab` is still a [chord](keys.md) and a palette entry, and a
pane can no longer be dropped onto it. The pane count and the prefix badge move
to the sidebar's bottom rows; the [status line](config.md) along the bottom
-keeps the full width. A terminal too narrow to give up the columns falls back
-to the top row until it grows.
+keeps the full width.
+
+**The bar fits itself to the terminal, and gives up the edge only when it has
+to.** `tab_bar_width` is a ceiling rather than a reservation: the sidebar is
+held to a third of the screen, so 18 columns is a margin beside a 90-column
+terminal and narrows to 16 beside a 50-column one, with the panes keeping the
+rest and never dropping below the width they collapse at. Only when even a
+legible sidebar (14 columns, or whatever narrower width you asked for) will not
+fit does the strip go back to the top row.
+
+Height counts too: a sidebar spends a
+row per tab, so a wide but short terminal runs out of list before it runs out
+of screen — and a tab with no row is not clipped, it is unreachable. When the
+rows for the labels and the `+` are not there, the strip goes back on top,
+where the same tabs lie along one row. Not when that row could not hold them
+either: with more tabs than the top strip can seat, moving them gains nothing
+and the side you configured stands. All of it is re-derived per frame from the
+terminal's size, so a resize moves the bar and nothing remembers it did.
**The sidebar is framed like a pane**, so it belongs to the chrome rather than
floating beside it. Under [`compact`](config.md#compact) the frame's inner line
diff --git a/docs/slosh.5 b/docs/slosh.5
index 3c1a43a..6226cf9 100644
--- a/docs/slosh.5
+++ b/docs/slosh.5
@@ -129,11 +129,17 @@ line's side margin.
.TP
.BR tab_bar_side\ \fIside\fR ,\ tab_bar_width\ \fIn\fR ,\ tab_bar_pad\ \fIn\fR
Where the tab strip lives: \fBtop\fR (the default), or a sidebar on the
-\fBleft\fR or \fBright\fR listing one tab per row, \fBtab_bar_width\fR
-columns wide, with \fBtab_bar_pad\fR blank rows above the first tab.
+\fBleft\fR or \fBright\fR listing one tab per row, at most
+\fBtab_bar_width\fR columns wide, with \fBtab_bar_pad\fR blank rows above
+the first tab.
The strip's indicators move to the sidebar's bottom rows; the status line
-keeps the full width. A terminal too narrow to give up the columns falls
-back to \fBtop\fR until it grows.
+keeps the full width.
+The width is a ceiling, not a reservation: a sidebar narrows to fit a small
+screen \(em never more than a third of it, never into the columns a pane
+collapses at \(em and falls back to \fBtop\fR when what is left would be too
+narrow to read a name in, or when the terminal is too short to give every tab
+a row (unless the top strip could not seat them either, where nothing is
+gained by moving them). Re-derived per frame, so a resize moves the bar.
.TP
.BI tab_bar_padding\ n\ ...
Air inside a sidebar, between its frame and the list, per side and in