From d39c0d38eda5fecfbc0d1c3adaa2457eac4180c0 Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Thu, 26 Mar 2026 13:38:24 -0400 Subject: [PATCH] fix: local PowerShell garbled output + resize not propagating Two issues: 1. convertEol was false for PTY sessions, but Windows ConPTY sends bare \n without \r. Now enabled on Windows PTY sessions (checked via navigator.platform). Unix PTY still false (driver handles it). 2. LocalTerminalView had no ResizeObserver, so the terminal never reflowed when the container size changed. Added ResizeObserver matching the SSH TerminalView pattern. Also added proper cleanup on unmount. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/components/terminal/LocalTerminalView.vue | 21 +++++++++++++++++-- src/composables/useTerminal.ts | 4 +++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/components/terminal/LocalTerminalView.vue b/src/components/terminal/LocalTerminalView.vue index 3d8d0c6..5a9e867 100644 --- a/src/components/terminal/LocalTerminalView.vue +++ b/src/components/terminal/LocalTerminalView.vue @@ -9,7 +9,7 @@ diff --git a/src/composables/useTerminal.ts b/src/composables/useTerminal.ts index bbebdf6..e672fbb 100644 --- a/src/composables/useTerminal.ts +++ b/src/composables/useTerminal.ts @@ -70,7 +70,9 @@ export function useTerminal(sessionId: string, backend: 'ssh' | 'pty' = 'ssh'): cursorStyle: "block", scrollback: 10000, allowProposedApi: true, - convertEol: backend === 'ssh', + // SSH always needs EOL conversion. PTY needs it on Windows (ConPTY sends bare \n) + // but not on Unix (PTY driver handles LF→CRLF). navigator.platform is the simplest check. + convertEol: backend === 'ssh' || navigator.platform.startsWith('Win'), rightClickSelectsWord: false, });