MCP 服务 2026-09-28 02:32 UTC
core
由提交人 lulusir 提交,主要更新类型为:问题缺陷修复与稳定性提升。提交说明:fix(terminal-next): handle OSC 52 clipboard sequences in terminal (#4774)。解决了已知运行时异常与边界错误,提升系统稳定性。
Commit提交信息原文
fix(terminal-next): handle OSC 52 clipboard sequences in terminal (#4774) * fix(terminal-next): handle OSC 52 clipboard sequences in terminal TUI programs running inside the terminal (opencode, vim, tmux etc.) set the clipboard by emitting OSC 52 sequences. xterm.js core does not register a handler for this identifier, so the sequence was silently dropped. In web/remote scenarios the native command fallback (osascript, xclip...) writes the clipboard of the machine hosting the backend instead of the user's browser clipboard, leaving copy features broken. Register an OSC 52 handler on each XTerm instance, decode the base64 payload as UTF-8 and write it through IClipboardService. Query sequences (payload '?') and malformed payloads are ignored without affecting normal terminal output. * test(terminal-next): mock xterm parser API in client tests The OSC 52 clipboard handler introduced in the XTerm constructor calls Terminal.parser.registerOscHandler, but the mocked Terminal class in client.test.ts does not expose a parser property. The constructor therefore throws inside TerminalClient.init (whose rejection is unhandled), leaving this.xterm undefined and failing every client test with a misleading 'Cannot read properties of undefined (reading raw)'. * fix(terminal-next): validate OSC 52 selection target and reject invalid UTF-8 Only handle OSC 52 sequences whose selection parameter is empty or contains c (clipboard) / s (primary selection); ignore other targets such as cut buffers, per xterm's control sequence docs. Decode the base64 payload with a fatal UTF-8 TextDecoder so payloads that are not valid UTF-8 are ignored instead of writing replacement characters to the clipboard. * test(playwright): drive theme selection via e2e command bridge The theme persistence e2e opened the command palette with Ctrl+Shift+P and clicked the re-rendering quickpick item; the item keeps detaching while the quickpick list re-renders, so the click retried until the 120s timeout on all retries (the same failure exists on main at 9fee6aa38, so this is a pre-existing flake, not a regression of this branch). Execute workbench.action.selectTheme through the e2e command bridge and pick the theme option directly, backporting the stabilized version that already runs green on codex/improve-acp-error-message.