Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

125
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda