Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reflow doesn't work #1941

Closed
svenefftinge opened this issue Feb 13, 2019 · 9 comments
Closed

Reflow doesn't work #1941

svenefftinge opened this issue Feb 13, 2019 · 9 comments
Labels
type/bug Something is misbehaving

Comments

@svenefftinge
Copy link

svenefftinge commented Feb 13, 2019

I tried to get the new reflow support (#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

@mofux
Copy link
Contributor

mofux commented Feb 14, 2019

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?

@mofux mofux added the type/bug Something is misbehaving label Feb 14, 2019
@AndrienkoAleksandr
Copy link
Contributor

AndrienkoAleksandr commented Feb 14, 2019

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.

@Tyriar
Copy link
Member

Tyriar commented Feb 14, 2019

@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

@svenefftinge
Copy link
Author

Ok, thanks I will try that.

@Tyriar
Copy link
Member

Tyriar commented Feb 14, 2019

Np, @mofux found #1944 after discussing this 👌

@akosyakov
Copy link

akosyakov commented Mar 25, 2019

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

@Tyriar Could it be reopened?

@Tyriar
Copy link
Member

Tyriar commented Mar 25, 2019

@akosyakov tracking the remaining crash in #1932

@akosyakov
Copy link

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.

@Tyriar
Copy link
Member

Tyriar commented Apr 7, 2019

@akosyakov the errors in #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is misbehaving
Projects
None yet
Development

No branches or pull requests

5 participants