Skip to content

Commit 8f31735

Browse files
committed
fix: shared termninals
1 parent a2eb961 commit 8f31735

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

app/components/Terminal.client.vue

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,12 @@ 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.
119+
// Subscribers just adapt locally — never resize the shared PTY.
120+
// Only creators sync dimensions (PTY was just created at their size).
121121
nextTick(() => {
122122
doFit();
123-
if (term && ws && ws.readyState === WebSocket.OPEN) {
123+
if (!props.shareTerminalId && term && ws && ws.readyState === WebSocket.OPEN) {
124124
ws.send(JSON.stringify({ type: "resize", terminalId: sharedTerminalId, cols: term.cols, rows: term.rows }));
125-
// Ctrl+L: tell the shell to redraw the screen, clearing zsh PROMPT_SP `%`
126-
if (props.shareTerminalId) {
127-
ws.send(JSON.stringify({ type: "input", terminalId: sharedTerminalId, data: "\x0c" }));
128-
}
129125
}
130126
});
131127
} else if (msg.type === "output" && term) {

0 commit comments

Comments
 (0)