Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions frontend/app/view/term/term.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ const TermResyncHandler = React.memo(({ blockId, model }: TerminalViewProps) =>

React.useEffect(() => {
if (!model.termRef.current?.hasResized) {
// the initial resync (after load) uses the current status, so track it here or a
// disconnect/reconnect during load would look unchanged and skip the resync
setLastConnStatus(connStatus);
return;
}
const isConnected = connStatus?.status == "connected";
Expand Down
6 changes: 5 additions & 1 deletion frontend/app/view/term/termwrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ export class TermWrap {
await this.loadInitialTerminalData();
} finally {
this.loaded = true;
this.handleResize();
}
this.runProcessIdleTimeout();
}
Expand Down Expand Up @@ -571,7 +572,10 @@ export class TermWrap {
RpcApi.ControllerInputCommand(TabRpcClient, { blockid: this.blockId, termsize: termSize });
}
dlog("resize", `${this.terminal.rows}x${this.terminal.cols}`, `${oldRows}x${oldCols}`, this.hasResized);
if (!this.hasResized) {
// the initial resync can start the shell, so wait until the terminal has loaded.
// until then handleTermData drops xterm.js replies (e.g. DA1 for fish), and a
// query sent by a freshly started shell would never get its answer.
if (!this.hasResized && this.loaded) {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
this.hasResized = true;
this.resyncController("initial resize");
}
Expand Down