Repository navigation
Conversation
Render overflowing command lines through an independent visual-row viewport and capture the mouse wheel only while it is scrollable. Preserve the command buffer and cursor while scrolling, and restore terminal mouse and cursor state across handoffs and exit paths. Add incremental viewport repainting, a status indicator, documentation, and interactive regressions for soft wraps, execution, nested readers, and SIGHUP cleanup. Fixes fish-shell#11029
Member
|
Unmarked slop |
krobelus
reviewed
Sep 1, 2026
|
|
||
| Interactive improvements | ||
| ------------------------ | ||
| - Commands that are taller than the terminal can now be browsed with the mouse wheel. The viewport follows keyboard cursor movement only when the cursor crosses an edge, and its status line reminds users what :kbd:`enter` does. Fish captures the wheel only while the command-line viewport is scrollable and returns it to the terminal when the command fits again (:issue:`11029`). |
Contributor
There was a problem hiding this comment.
Hi, this is amazing, I think this is exactly the behavior we want.
However I'd clean up a few things before merging this.
For example, this obsoletes the existing implementation of "scrolling" (for example the autoscroll function) so we should remove that code, to minimize a future reader's confusion.
Let me know if you want to do that and you're interested in learning more about the fish code base.
| sp.send("\x1b[<64;1;1M") | ||
| sp.expect_str("\x1b[?25l") | ||
|
|
||
| # A HUP normally means the PTY disappeared, but if it is still writable Fish |
Contributor
There was a problem hiding this comment.
but is there a real-world scenario where it doesn't? If not we probably shouldn't add this
This branch has not been deployed
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.
Summary
This implements the command-line viewport approach discussed in #11029 instead of attempting to reconstruct unrendered input from terminal scrollback.
rows X to Y of N. Enter executes or continuesindicator and document the interactionKeyboard cursor movement follows the viewport only when it crosses an edge. Enter semantics are unchanged: a complete command executes immediately, while an incomplete command continues editing.
Testing
cargo xtask check(245 passed, 8 environment-dependent tests skipped)cargo +1.85.0 clippy --workspace --all-targets -- --deny=warningscargo xtask format --all --checkwith Ruff availableTODOs
Fixes #<issue-number>Fixes #11029