Indicate when terminal sticky scroll is truncated

Fixes #199974
pull/236721/head
Daniel Imms 2024-12-20 08:23:25 -08:00
parent decaa08e99
commit 62948ea6d8
No known key found for this signature in database
GPG Key ID: E5CF412B63651C69
1 changed files with 2 additions and 1 deletions

View File

@ -265,6 +265,7 @@ export class TerminalStickyScrollOverlay extends Disposable {
const rowOffset = !isPartialCommand && command.endMarker ? Math.max(buffer.viewportY - command.endMarker.line + 1, 0) : 0;
const maxLineCount = Math.min(this._rawMaxLineCount, Math.floor(xterm.rows * Constants.StickyScrollPercentageCap));
const stickyScrollLineCount = Math.min(promptRowCount + commandRowCount - 1, maxLineCount) - rowOffset;
const isTruncated = stickyScrollLineCount < promptRowCount + commandRowCount - 1;
// Hide sticky scroll if it's currently on a line that contains it
if (buffer.viewportY <= stickyScrollLineStart) {
@ -293,7 +294,7 @@ export class TerminalStickyScrollOverlay extends Disposable {
start: stickyScrollLineStart + rowOffset,
end: stickyScrollLineStart + rowOffset + Math.max(stickyScrollLineCount - 1, 0)
}
});
}) + (isTruncated ? '\x1b[0m …' : '');
// If a partial command's sticky scroll would show nothing, just hide it. This is another
// edge case when using a pager or interactive editor.