Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
xtermjs dynamic height not updating correctly

I'm trying to make the height of xtermjs dynamic. I've looked around but the solutions don't seem to solve my issue. I played with CSS but the problem doesn't seem to be there. I'm also using the xterm-addon-fit.

As an example I created this sandbox to show the issue. I've added a dragging pane that has a somewhat hard to see black bar in the bottom. When I drag it, the xtermjs component doesn't resize.

In the image below, the black box with numbers (xterm) should be inside the orange box after we resize the orange box. codesandbox screenshot

I've used a component to make it easier to test, but it happens if we resize the window in other ways.

What am I missing here?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

As explained by @jerk, if we fit when the resize happens, it fixes the issue. This codesandbox with an extra hook makes it work. Although now to test it, you have to drag the console pane up and down instead of using the custom component.

  // It resizes xterm when the height changes
  useEffect(() => {
    fitAddon.fit();
  }, [height]);

Notice the auto scroll stops. Depending on the scenario, you might want to scroll to the bottom.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!