Skip to content

Commit 0889212

Browse files
committed
Sync PTY dimensions on shell session ready to prevent size mismatch
1 parent 95af494 commit 0889212

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

apps/twig/src/renderer/features/terminal/services/TerminalManager.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,15 @@ class TerminalManagerImpl {
229229

230230
if (instance.attachedElement) {
231231
instance.fitAddon.fit();
232+
trpcVanilla.shell.resize
233+
.mutate({
234+
sessionId,
235+
cols: instance.term.cols,
236+
rows: instance.term.rows,
237+
})
238+
.catch((error: Error) => {
239+
log.error("Failed to sync initial terminal size:", error);
240+
});
232241
}
233242

234243
this.emit("ready", {

0 commit comments

Comments
 (0)