Replies: 1 comment 2 replies
-
You can find the addon code here: https://github.com/xtermjs/xterm.js/blob/master/addons/xterm-addon-fit/src/FitAddon.ts |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be helpful to know how the fit addon works, Because I am having trouble getting the terminal to size correctly when the terminal is initially loaded with
display: none
. The terminal exists in my UI as part of a tabbed pane, which is not rendered on initial view. However, a user can click the terminal tab and the terminal will enter the view.On the initial view of the terminal tab, the terminal overflows the height significantly. However, tabbing away and back again will then render correctly. Im not sure why that happens. I also use ReactResizable component and can resize the terminal. This part works great however, because I can use
onResize
events tofit()
the terminal.So my only problem is when the terminal loads initially in a hidden state, it seems to be unable to detect the heights correctly. So knowing how the fitaddon works a bit could help me figure out the best way to load my terminal into view. I am doing my best to try and call
fit()
when the terminal is tabbed into view but this has not been successful so far.The docs on the fit addon are very light, it could be helpful to go over some gotchas or limitations in the fit Addon
Beta Was this translation helpful? Give feedback.
All reactions