Tabbed terminal panel, and drag-to-scroll a pane - #15
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two features for the browser viewer, plus the refactor that made room for them.
Tabs instead of a split. The panel can draw its panes one at a time behind a
tab strip; the button beside + switches between that and the side-by-side
grid. A narrow screen starts on tabs, because a split grid gives each pane fewer
columns than a command line needs. The choice is stored per device rather than on
the server — what a phone should do with four panes is not what the desktop
beside it should do.
Nothing about the session changes: + still sends
create, tabs sit in paneorder, and a tab you are not looking at is a running program whose output keeps
arriving. Every pane is held at the panel's full size while tabbed, so switching
costs no resize — a zero-size cell would defer opening the terminal and skip its
sizing, making each switch a fit plus a SIGWINCH plus a full repaint.
A tabbed panel shows no zoom button (it already shows one pane), and a zoom
another client set does not move the keyboard there.
Drag a pane to scroll it. A finger dragged up or down turns the same wheel a
mouse would and lets xterm route it, so where it goes is up to the program in the
pane — a mouse-reporting agent gets its SGR report,
lessunder alternate scrollgets arrow keys, a plain shell scrolls the scrollback.
defaultPreventedis theseam; what xterm did not claim is scrolled with
term.scrollLines, since asynthetic wheel cannot drive the browser scrolling xterm's scrollback relies on.
A short drag is still a tap, so placing the cursor and pinching to zoom survive.
Verified in a browser at a phone viewport against a live daemon: SGR reports
reaching the PTY on a mouse-reporting pane, and a bash pane's scrollback moving
symmetrically both ways;
+adding a tab rather than splitting, with the hiddenpane holding the same box as the visible one.
Gates:
cargo build,cargo test(1498),cargo clippy -D warnings,tsc -b,vitest run(205), and aviewer-ui/distrebuilt from this source.