Skip to content

Commit 38d53d6

Browse files
committed
repl: fix screen refresh in multiline viewport overflow
When multiline REPL input exceeds the terminal height, navigating the cursor would move the cursor position correctly but fail to refresh the screen properly, leaving stale content visible. This implements viewport-based rendering in kRefreshLine() that displays only the visible portion of input centered around the cursor position when content exceeds terminal height.
1 parent 3e1e1d0 commit 38d53d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/readline/interface.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ class Interface extends InterfaceConstructor {
553553
this[kWriteToOutput](`\n${kMultilinePrompt.description}` + lines[i]);
554554
}
555555

556-
this.prevRows = exceedsTerminal ? visibleCursorRow : cursorPos.rows;
556+
this.prevRows = exceedsTerminal ? visibleCursorRow : cursorPos.rows;
557557
} else {
558558
// Write the prompt and the current buffer content.
559559
this[kWriteToOutput](line);

0 commit comments

Comments
 (0)