Fit addon fails to propose correct dimenions

See original GitHub issue

This issue came up when I tried to update from xterm 5.0.0 to 5.1.0. xterm-addon-fit is the same version 0.6.0

First the fit() method as called before does not work and upon some debugging, proposeDimensions() always returns Object { cols: NaN, rows: NaN }

Unfortunately I have no clue how to debug this further as stepping through the function with the debugger and sourcemaps mostly shows undefined objects and skips lines and I don’t know how to build the assets correctly from the .ts files if I’d want to add some console.log()s.

There are some suspicious comments like https://github.com/xtermjs/xterm.js/blob/master/addons/xterm-addon-fit/src/FitAddon.ts#L60 which may hint at the issue?

Details

  • Browser and browser version: both current ff and chrome
  • xterm.js version: 5.1.0

Steps to reproduce

The code is essentially just the example code from the addon Readme and it used to work.

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jerchcommented, Dec 21, 2022

@Tyriar I think the fit addon misses a version bump for 5.1 release as there were changes to it?

As an interim fix you can use 0.7.0-beta.2, which contains the latest code changes.

0reactions
nebuladecommented, Dec 23, 2022

Great and thanks for the super fast reaction on this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

The .fit() method of the fit add-on does not work when loaded ...
I get the following error message: ERROR TypeError: Cannot read property 'dimensions' of undefined at e.proposeDimensions (FitAddon.ts:20) .
Read more >
xterm-addon-fit - npm
An addon for xterm. js that enables fitting the terminal's dimensions to a containing element. This addon requires xterm. js v4+.
Read more >
xterm-for-react with xterm-addon-fit throws unable to read ...
I am using xterm-for-react for terminal integration and I want to resize that terminal window as my wrapper div tag around the component ......
Read more >
How to Fix Misaligned Labels Templates?
Check your printer settings; Decrease the font size or reduce the amount of text; Make sure you are using the correct labels. 1....
Read more >
Top 5 xterm-addon-fit Code Examples - Snyk
To help you get started, we've selected a few xterm-addon-fit examples, based on popular ways it is used in public projects.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found