-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
FitAddon resizes incorrectly #4841
Comments
Yeah , i am also facing same |
Wrong understanding. |
|
I just ran into this. In my case I was calling fit before terminal.open() const terminal = new Terminal();
const fitAddon = new FitAddon();
terminal.loadAddon(fitAddon);
terminal.open(myHTMLRef);
fitAddon.fit(); |
Cant repro that. Still there is a chance though, that dimension calc might have slightly changed due to #4366, which switched from float to integer measuring of the reference char for the cell dimension. |
I can repro .......... |
issue
|
@tisilent As far as I see |
@jerch This is a small tool. It's using Dom renderer. |
same problem, look like term.resize bug, columns set 80 will be ok, set 90 will error. |
i use a setTimeout to resolve this problem,when i directly use proposeDimensions, it is undefined. i am confused
|
@carolin-violet proposeDimensions is undefined if you try to call it before the terminal element has a DOM representation. Plz make sure to call it after calling |
This may be not a bug,you should tell the channel size info. then it will work. // browser side
const terminal = new Terminal();
const fitAddon = new FitAddon();
terminal.loadAddon(fitAddon);
terminal.open(el);
fitAddon.fit();
const info = { width: el.offsetWidth, height: el.offsetHeight ,...fitAddon.proposeDimensions() } //size info
//node side
client.shell((err, channel)=>{
channel.setWindow(info.rows, info.cols, info.height, info.width);//cols default 80, set size info
}) |
In the new version of Chrome, my problem is no reproducing... |
Details
Steps to reproduce
The resized dimension do not take all the available space, instead, I need to use this code to use all the available space:
The text was updated successfully, but these errors were encountered: