Repository navigation
Conversation
When the screen is split into side-by-side panes, as tmux, vim and emacs draw them, typing in one pane changes only that pane. The prediction engine assumed the whole rest of the row moves, so a key typed in any pane but the rightmost shifted the borders and the panes to its right. When the server's echo arrived, the moved border did not match, and mosh threw away all predictions and waited for the server again. In those panes there was effectively no local echo, and keys typed ahead made the borders jump right and back. The engine now finds the pane around the cursor on the screen: a vertical line (U+2502, U+2503, U+2551 or '|') that continues on the row above or below. Typing, backspace, the arrow keys, wrapping and Enter stay between those borders, and a key typed at a pane's left edge no longer takes the border's colours. Without borders the pane is the whole row, as before. MOSH_PREDICTION_PANES=no restores the old behaviour. The prediction engine moves into libmoshoverlay.a so that the new test, src/tests/prediction-panes.cc, can drive it against the real emulator. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clang-format 14 breaks the braced initializer in the TEST() macro over several lines. Build each entry with a constructor instead, which it leaves on one line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
We are not accepting LLM contributions at this time. |
Author
I'm sorry, is this documented somewhere? I tried to look before submitting (PR template, contributor's guide, etc) but couldn't find anything. |
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.
When the screen is split into side-by-side panes (tmux with vertical splits, vim's
:vsplit, emacs side-by-side windows), typing in one pane changes only that pane. The prediction engine assumes the whole rest of the row moves, so a key typed in any pane but the rightmost is predicted to push the pane borders and the neighbouring panes one cell to the right, and backspace pulls them left. When the server's echo arrives, the moved border does not match, so all predictions are discarded and the engine waits for the server again. In those panes there is effectively no local echo, and keys typed ahead make the borders jump right and back.This change finds the pane around the cursor on the displayed frame: the nearest column on each side that holds a vertical line (U+2502, U+2503, U+2551 or
|) continuing on the row above or below, so a lone|in a shell pipeline is not a border. Insertion, backspace, the left and right arrows, last-column handling and wrap, and CR use the pane's edges instead of the screen's, and a character typed at a pane's left edge no longer copies the border's renditions. Without such borders the pane is the whole row, and nothing changes.MOSH_PREDICTION_PANES=norestores the old behaviour.terminaloverlay.ccmoves into anoinstlibrary so that the newsrc/tests/prediction-panescan drivePredictionEngineagainst a realTerminal::Complete; 13 of its 15 tests fail on master.make checkpasses, the lines added toterminaloverlay.cchave 100% line coverage, and I have been using it in tmux with four side-by-side panes over a real link.🤖 Generated with Claude Code