Skip to content

Commit 8d5e172

Browse files
authored
fix: Sync PTY dimensions on shell session ready to prevent size mismatch (#853)
Closes #847
1 parent 5d3b52a commit 8d5e172

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)