Skip to content

Commit 1687c3c

Browse files
committed
fix: revert previous changes
1 parent f61051a commit 1687c3c

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

app/components/Terminal.client.vue

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,11 @@ function connectWs() {
116116
if (!props.shareTerminalId) {
117117
emit("shareCreated", msg.terminalId, msg.name ?? "");
118118
}
119-
// Subscribers just adapt locally via doFit() — never resize the PTY.
120-
// Resizing would change dimensions for all peers, causing cursor glitch
121-
// and zsh PROMPT_SP `%` on the terminal creator's side.
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.
122121
nextTick(() => {
123122
doFit();
124-
if (!props.shareTerminalId && term && ws && ws.readyState === WebSocket.OPEN) {
125-
// Only newly created terminals sync PTY dimensions
123+
if (term && ws && ws.readyState === WebSocket.OPEN) {
126124
ws.send(JSON.stringify({ type: "resize", terminalId: sharedTerminalId, cols: term.cols, rows: term.rows }));
127125
}
128126
});
@@ -262,10 +260,7 @@ onMounted(async () => {
262260
if (useLocalPty) {
263261
electronTerminal!.resize(termId, term.cols, term.rows);
264262
} else if (ws && ws.readyState === WebSocket.OPEN) {
265-
// In share mode, only the host sends resize to avoid breaking other peers' cursors
266-
if (isSharing.value && !shareIsHost.value) {
267-
// Guest: local fit only, no PTY resize
268-
} else if (sharedTerminalId) {
263+
if (sharedTerminalId) {
269264
ws.send(JSON.stringify({ type: "resize", terminalId: sharedTerminalId, cols: term.cols, rows: term.rows }));
270265
} else {
271266
ws.send(JSON.stringify({ type: "resize", cols: term.cols, rows: term.rows }));

0 commit comments

Comments
 (0)