Skip to content

Commit 4492d38

Browse files
committed
fix: shared terminal size handling
1 parent b154ee9 commit 4492d38

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

app/components/Terminal.client.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ function connectWs() {
116116
if (!props.shareTerminalId) {
117117
emit("shareCreated", msg.terminalId, msg.name ?? "");
118118
}
119+
// Re-fit and notify PTY of actual dimensions — the replayed output may have
120+
// been at different dimensions (guest vs host), causing zsh PROMPT_SP glitch.
121+
nextTick(() => {
122+
doFit();
123+
if (term && ws && ws.readyState === WebSocket.OPEN) {
124+
ws.send(JSON.stringify({ type: "resize", terminalId: sharedTerminalId, cols: term.cols, rows: term.rows }));
125+
}
126+
});
119127
} else if (msg.type === "output" && term) {
120128
term.write(msg.data);
121129
} else if (msg.type === "exit" && term) {

0 commit comments

Comments
 (0)