You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
)
However, I want to clear the current buffer without causing the scroll event to fire.
Since I want to replace the current buffer with new buffer. My implementation is like this:
While we should maybe not be firing that event if ydisp was 0 before, we fire it because the scroll bar/scroll state changed. As for the double rendering, this is by design since writing to the terminal is always queued/async:
There is no way to do an atomic render like this and I don't think it's worth adding, but in your case you could hide the element temporarily and then show it again
// hide the terminal elementterminal.clear()// FYI forEach is better here as it will not create and return another arraynewBuffer.forEach(line=>terminal.writeln(line))terminal.scrollToBottom()// show the terminal element
Hi everyone, I am really new to xterm.js and maybe suggesting a very dump question.
Every single time, the clear() method is called, the scroll event is fired as the source here shows:
(
xterm.js/src/browser/Terminal.ts
Lines 1323 to 1339 in 48b8e31
However, I want to clear the current buffer without causing the scroll event to fire.
Since I want to replace the current buffer with new buffer. My implementation is like this:
But the terminal instance is rendered twice, 1 after clear() 2. the terminal with newBuffer. And the scroll event is fired in between.
I want to
The text was updated successfully, but these errors were encountered: