Fix terminal size on connect — send dimensions after handshake
Root cause: The PTY is allocated at 80x24 during the SSH handshake. The frontend xterm.js fits correctly to the container (e.g. 120x35), but term.onResize fires before the backend connection is ready, so the ResizeSession call is silently rejected. When the connection completes, fitAddon.fit() sees the terminal already has the right cols/rows and does NOT fire another onResize event. The PTY stays at 80x24. Fix: On 'session:state → connected', explicitly read the current terminal cols/rows and send them to the backend via ResizeSession, bypassing the onResize event dependency. Also fix empty-state ordering in addTab() — hide the empty-state BEFORE activating the panel so the panel-container gets the full workspace height immediately (empty-state has flex:1 and was stealing half the height during initial layout). Simplify createTerminal() fit logic — force a synchronous reflow via offsetHeight access, then fit immediately.
This commit is contained in:
@@ -47,8 +47,10 @@ class TabManager {
|
||||
panel.style.display = 'none';
|
||||
this.panelContainer.appendChild(panel);
|
||||
|
||||
this.setActive(sessionInfo.id);
|
||||
// Hide the empty-state BEFORE activating the panel so the
|
||||
// panel-container gets the full workspace height immediately.
|
||||
this._updateEmptyState();
|
||||
this.setActive(sessionInfo.id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user