From 287c4e0898ceaae74481ba499f62c57db925d026 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Tue, 24 Mar 2026 18:29:31 -0700 Subject: [PATCH] fix: stop sending cursor style escape sequences to PTY as input The cursor style sequence (e.g. \e[5 q) was being sent to the shell via sendInput(), causing literal "[5 q" text to appear in the terminal. The shell doesn't interpret DECSCUSR sequences. Cursor style is already correctly applied via xterm.js terminal options. Co-Authored-By: Claude Opus 4.6 --- .../components/terminal-pane/terminal-appearance.ts | 11 +---------- .../terminal-pane/use-terminal-pane-lifecycle.ts | 3 +-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/renderer/src/components/terminal-pane/terminal-appearance.ts b/src/renderer/src/components/terminal-pane/terminal-appearance.ts index 468386c8e6d..7bce88a78f5 100644 --- a/src/renderer/src/components/terminal-pane/terminal-appearance.ts +++ b/src/renderer/src/components/terminal-pane/terminal-appearance.ts @@ -2,26 +2,19 @@ import type { ITheme } from '@xterm/xterm' import type { PaneManager } from '@/lib/pane-manager/pane-manager' import type { GlobalSettings } from '../../../../shared/types' import { - getCursorStyleSequence, getBuiltinTheme, resolvePaneStyleOptions, resolveEffectiveTerminalAppearance } from '@/lib/terminal-theme' -import type { PtyTransport } from './pty-transport' export function applyTerminalAppearance( manager: PaneManager, settings: GlobalSettings, systemPrefersDark: boolean, - paneFontSizes: Map, - paneTransports: Map + paneFontSizes: Map ): void { const appearance = resolveEffectiveTerminalAppearance(settings, systemPrefersDark) const paneStyles = resolvePaneStyleOptions(settings) - const cursorSequence = getCursorStyleSequence( - settings.terminalCursorStyle, - settings.terminalCursorBlink - ) const theme: ITheme | null = appearance.theme ?? getBuiltinTheme(appearance.themeName) const paneBackground = theme?.background ?? '#000000' @@ -38,8 +31,6 @@ export function applyTerminalAppearance( } catch { /* ignore */ } - const transport = paneTransports.get(pane.id) - transport?.sendInput(cursorSequence) } manager.setPaneStyleOptions({ diff --git a/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts b/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts index 9d87a31366d..f60cb602b85 100644 --- a/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts +++ b/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts @@ -82,8 +82,7 @@ export function useTerminalPaneLifecycle({ manager, currentSettings, systemPrefersDarkRef.current, - paneFontSizesRef.current, - paneTransportsRef.current + paneFontSizesRef.current ) }