Xterm.js: Reflow doesn't work

Created on 13 Feb 2019  路  9Comments  路  Source: xtermjs/xterm.js

I tried to get the new reflow support (https://github.com/xtermjs/xterm.js/pull/1864) enabled but don't know how. @Tyriar mentioned

Note that this only works when the TypedArray buffer is enabled.

Could you tell me how to do that?
When automating the resize for the demo it behaves like below:

xterm-resize

Here's the gitpod workspace from the gif to reproduce:

Open in Gitpod

typbug

All 9 comments

The pure demo without login to Gitpod can be found here: https://3000-e2881ed9-8762-4946-afe1-48d0f11b255f.ws-eu0.gitpod.io

My guess is that it's happening because the prompt input line is reflowed by the pty itself, and we are putting our reflow mechanism on top, which causes this strange behavior. You can see in the capture that the (real) prompt line is always preserved and correctly reflowed.

If you ls -alh inside that terminal, you can see that its output is also correctly reflowed.

@Tyriar Any thoughts?

My guess is that it's happening because the prompt input line is reflowed by the pty itself,

@mofux seems You are right:

xtermnewreflow

On each resize pty send prompt update.

@svenefftinge the typed array buffer is the only option now and it's on by default because of this line in the release notes: "Removed old js array-based buffer implementation"

My guess is that it's happening because the prompt input line is reflowed by the pty itself

The line containing the cursor remains untouched by reflow, also all other terminals I've looked at act similarly to this when wrapping the prompt line so I think we're behaving correctly. Debouncing resize should also help with this as it will prevent issues around race conditions where the pty size and xterm.js size are out of sync, I added a note to the resize method to call this out:

https://github.com/xtermjs/xterm.js/blob/3.11.0/typings/xterm.d.ts#L445

Ok, thanks I will try that.

Np, @mofux found https://github.com/xtermjs/xterm.js/issues/1944 after discussing this 馃憣

It's still an issue ~in 3.12~ on master. In order to reproduce with xtermjs
Open in Gitpod

@Tyriar Could it be reopened?

@akosyakov tracking the remaining crash in https://github.com/xtermjs/xterm.js/issues/1932

Actually i'm not sure it is #1932. I can reproduce it with an example by changing cols between 10 and 80. Each time more and more lines appear but no errors in console like in #1932.

@akosyakov the errors in https://github.com/xtermjs/xterm.js/issues/1932 are just one of the errors that could happen if the buffer numbers are invalid, I think it just depends on what is run after the corruption occurs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tandatle picture tandatle  路  3Comments

Tyriar picture Tyriar  路  4Comments

circuitry2 picture circuitry2  路  4Comments

travisobregon picture travisobregon  路  3Comments

Tyriar picture Tyriar  路  4Comments