diff --git a/cptr/frontend/src/lib/components/Terminal.svelte b/cptr/frontend/src/lib/components/Terminal.svelte index 286ea69..bfe7322 100644 --- a/cptr/frontend/src/lib/components/Terminal.svelte +++ b/cptr/frontend/src/lib/components/Terminal.svelte @@ -62,9 +62,6 @@ if (rect.width === 0 || rect.height === 0) return; try { fitAddon.fit(); - // Do NOT scroll after fit. Rich CLI apps (htop, vim, Claude Code) - // manage their own cursor/viewport after SIGWINCH. Forcing scroll - // interferes with their rendering. } catch { // FitAddon can throw if terminal not properly attached } @@ -192,6 +189,18 @@ fitAddon = new FitAddon(); term.loadAddon(fitAddon); term.open(containerEl); + // // iOS: Move xterm's textarea from inside .xterm-helpers (position:absolute, + // // offscreen) to a flex sibling BELOW the terminal. + // if ('ontouchstart' in window && term.textarea) { + // containerEl.after(term.textarea); + // term.focus = () => term.textarea?.focus(); + // + // // xterm's mousedown calls ev.preventDefault() which blocks iOS + // // viewport adjustment. Focus on touchstart (fires before mousedown). + // containerEl.addEventListener('touchstart', () => { + // term.textarea?.focus(); + // }, { passive: true }); + // } // GPU-accelerated rendering, 2-5x faster than canvas 2D. // Falls back to canvas if WebGL is unavailable. @@ -374,7 +383,10 @@ }); -
+