panel icon indicating copy to clipboard operation
panel copied to clipboard

Server Console initial terminal size calculations incorrect

Open Linguardium opened this issue 8 months ago • 2 comments

https://github.com/pelican-dev/panel/blob/329a29f7daad089dd3901cc06fd68b2075cd76d0/resources/views/filament/components/server-console.blade.php#L84-L88

Current code sets the fit during loading which causes the fit addon to use incorrect sizes for resizing the terminal. This causes the console lines to overflow the terminal pane (and the terminal scrollbar...) breaking scrollbar dragging and causing text to not be visible.

Adding a load event handler here to resize once the page has loaded should fix the issue.

        fitAddon.fit(); //Fit on first load

        // adjust the terminal dimensions when the window resizes
        window.addEventListener('resize', () => {
            fitAddon.fit();
        });

        // set the initial terminal dimensions after all components load
        window.addEventListener('load', () => {
            fitAddon.fit();
        });

Linguardium avatar Apr 26 '25 17:04 Linguardium

Thanks, we'll look into this shortly!

lancepioch avatar Apr 27 '25 01:04 lancepioch

Looks like this only fixes the issue on page load if the server console is the first page/main page being loaded (such as a refresh). if another page loads (such as the main sever selection page), it will still load with the wrong dimensions. another event/trigger may be the better to resolve this when the console page is fully loaded, instead.

Linguardium avatar Apr 27 '25 16:04 Linguardium

I'd appreciate a fix for this, it's a tiny thing but after using the panel for the first time this is the only bug I've noticed so far.

ptlthg avatar Jul 13 '25 22:07 ptlthg