mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-14 10:39:32 +01:00
fix(remote): keep the remote screen rows above the local frame in a remote history load
The remote history and the local frame are read a round trip apart, so two seams dropped rows at the join: rows that scrolled off the screen during the round trip, and the top of a remote screen taller than this pane (a shared session sized by a taller client under window-size latest). Both are rows of the remote screen above where the local frame begins. The remote script now also captures the screen, right after the history, in the same round trip. joinScrollbackAndFrame() places the local frame among the screen rows (findFrameInScreen(): text compare with escape sequences and trailing blanks ignored, the screen's trailing blank rows and last content row left out, at least three rows of overlap with two of them non-blank, highest match wins) and keeps the screen rows above it between the history and the frame. When the frame cannot be placed, the join is history over frame as before. The read's buffer slack grows to 1 MiB, since the screen is outside the tail -c bound. Left: the history and screen are two tmux commands, so a row that scrolls between them (milliseconds) is lost, and a screen that repeats a whole block can place the frame at the higher copy, losing the rows between the copies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
136f11549b
commit
28b41efa58
7 files changed
+267
-42
No files matched your search
@@ -3128,7 +3128,10 @@ export function registerSessionRoutes(
|
||||
captureOpts.historyLimitLines,
|
||||
terminalBufferMaxBytes
|
||||
);
|
||||
if (remoteScrollback !== null) captureOpts.scrollbackOverride = remoteScrollback;
|
||||
if (remoteScrollback !== null) {
|
||||
captureOpts.scrollbackOverride = remoteScrollback.scrollback;
|
||||
captureOpts.scrollbackOverrideScreen = remoteScrollback.screen;
|
||||
}
|
||||
}
|
||||
const liveMuxBuffer =
|
||||
muxName && typeof ctx.mux.captureActivePaneBuffer === 'function'
|
||||
|
||||
Reference in new issue
Block a user