Resize/reflow broken
See original GitHub issueResize is pretty broken, as it doesn’t properly wrap text. This is making it difficult to create split panes which are resized often. I’ve tested this behavior in VSCode and it appears to be an issue there as well. I suspect this may be an inherit problem with the renderer/pty coordination, as I also see this issue (mildly) in both iTerm and the native MacOS terminal.
Details
- Browser and browser version: Electron 8.0.1
- OS version: MacOS Mojave 10.14.6
- xterm.js version: 4.4.0
Steps to reproduce
- Create xterm window hooked up to pty (https://github.com/microsoft/node-pty/tree/master/examples/electron).
- Use a
resizeObserver
on the top-level container that callsfitAddon.fit()
, then propagates the rows/cols to pty. - Rapidly resize the window.
I’ve tried debouncing the resize calls, but this doesn’t help.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Resize / Reflow Issues #4419 - alacritty/alacritty - GitHub
Terminal contents of the window do not correctly resize/reflow upon resizing the window, instead the contents get jumbled up.
Read more >Resizing window applications broken - Microsoft Community
The issue you're experiencing with modifying the window size of your Windows apps might be due to a corrupted system file. That being...
Read more >txt resize/reflow in browser zoom | XDA Forums
so basically, reflowing txt to your zoom width doesn't work, not existent, broken, on Samsung devices. Sent from my SPH-L900 using xda app-developers...
Read more >370952 - Fix the reflow functions in nsPresShell - Bugzilla@Mozilla
Fixing ResizeReflow: ResizeReflow() simply sets the size of the viewport in the prescontext, sets a resize reflow notification on the root frame, ...
Read more >Reflow issue when resizing: div size should be updated
When I resize the browser's height, the two divs at the top and bottom of the pink div don't get their width updated,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jerch Fair enough, thanks for explaining a possible solution. Will try to work around this by simply debouncing the pty resize and creating a UX that mitigates this behavior.
Closing this now, but submitting another sizing bug that I think is unrelated to this behavior.
@gfadlallah Yepp, this summarizes the problem behind the curtain.
This wont work either, as we dont know whether the next chunks are a result of SIGWINCH, where the app tries to “repair” the screen state.
Only chance I see is to do the full roundtrip and drain buffers in between:
This should lower the chance of the race condition by far. Downside of this solution is the implementation overhead (needs several server side adjustments, that are beyond xterm.js control) and the full stop on all interfaces.