Closed jpark799 closed 1 month ago
Nevermind, I figured out the issue. In case anyone else runs into a similar issue, I had to actually give a max width and height as well as 100% for both height and width for the div so something like this:
width: 100%;
height: 100%;
max-height: 24rem
max-width: 48rem
I'm using tailwind so this is what it looked like: <div className="size-full max-h-96 max-w-3xl" ref={terminalRef} />
The initial
fitAddon.fit()
works but I am running it again each time a user resizes their window and for some reason, it keeps shrinking in height when that is not expected. When adjusting from the window left to right, the terminal will resize correctly in width but it also shrinks each time in height. I thought there may be some underlying styling issues with my app so I tried this in a freshcreate-react-app
and i was getting the same behaviorCode:
App.tsx
utils.tsx
Details