Repository navigation
fix(tui): route selection copy through the host clipboard so "Copied!" is truthful - #8110
Merged
badlogic merged 2 commits intoAug 14, 2026
Conversation
added 2 commits
August 12, 2026 00:06
TuiAltScreen.copySelectionToClipboard() wrote a bare OSC 52 sequence and flashed "Copied!" unconditionally. Terminals that ignore OSC 52 clipboard writes (macOS Terminal.app, VTE terminals, tmux without OSC 52 passthrough) left the system clipboard untouched while the toast reported success. Add an injectable copySelection option to TuiAltScreenOptions (an async handler returning whether the copy succeeded) and use it when provided, falling back to the existing OSC 52 write otherwise. The coding agent now injects its native clipboard implementation (clipboard addon + pbcopy / wl-copy / xclip / xsel), so selection copy reaches the real clipboard and the toast only fires on verified success, with "Copy failed" otherwise. Closes earendil-works#7761
Collaborator
|
cheers |
xz-dev
pushed a commit
to xz-dev/pi
that referenced
this pull request
Aug 15, 2026
…orks#8110) TuiAltScreen.copySelectionToClipboard() wrote a bare OSC 52 sequence and flashed "Copied!" unconditionally. Terminals that ignore OSC 52 clipboard writes (macOS Terminal.app, VTE terminals, tmux without OSC 52 passthrough) left the system clipboard untouched while the toast reported success. Add an injectable copySelection option to TuiAltScreenOptions (an async handler returning whether the copy succeeded) and use it when provided, falling back to the existing OSC 52 write otherwise. The coding agent now injects its native clipboard implementation (clipboard addon + pbcopy / wl-copy / xclip / xsel), so selection copy reaches the real clipboard and the toast only fires on verified success, with "Copy failed" otherwise. Closes earendil-works#7761 Co-authored-by: 富永 誠 <makoto@credify.one>
tunght13488
added a commit
to tunght13488/pi
that referenced
this pull request
Aug 16, 2026
* upstream/main: (135 commits) fix(ai): retry Copilot GET /models once on 429 during login fix(ai): enable Copilot model policies sequentially during login chore: approve contributors from issue earendil-works#8124 fix(coding-agent): update Z.AI Coding Plan defaults agents: Adjust rules for changelog entries Add [Unreleased] section for next cycle Release v0.84.2 docs: audit changelogs since v0.84.1 docs: audit changelogs since v0.84.1 fix(tui): route selection copy through the host clipboard (earendil-works#8110) chore: approve contributors from issue earendil-works#8092 fix(coding-agent): use APP_NAME in user-facing messages (earendil-works#8067) fix(ai): preserve Google length stops with tool calls chore: approve contributors from issue earendil-works#8063 chore: approve contributors from issue earendil-works#8018 chore: approve contributors from issue earendil-works#8007 fix(coding-agent): collapse fallback tool output closes earendil-works#7979 fix(tui): handle generic SGR mouse releases fix(coding-agent): update vulnerable nanoid dependency chore: approve contributors from issue earendil-works#7973 ...
dadezzz
pushed a commit
to dadezzz/forgejo-agent
that referenced
this pull request
Aug 19, 2026
….2 (#213) This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [@earendil-works/pi-coding-agent](https://github.com/earendil-works/pi) ([source](https://github.com/earendil-works/pi/tree/HEAD/packages/coding-agent)) | [`0.84.1` → `0.84.2`](https://renovatebot.com/diffs/npm/@earendil-works%2fpi-coding-agent/0.84.1/0.84.2) |  |  | --- ### Release Notes <details> <summary>earendil-works/pi (@​earendil-works/pi-coding-agent)</summary> ### [`v0.84.2`](https://github.com/earendil-works/pi/blob/HEAD/packages/coding-agent/CHANGELOG.md#0842---2026-08-14) [Compare Source](earendil-works/pi@v0.84.1...v0.84.2) ##### New Features - **Fullscreen transcript search** — Search and navigate matches in fullscreen mode. See [TUI Fullscreen Viewport](docs/keybindings.md#tui-fullscreen-viewport). - **Configurable default tools** — Choose startup built-in tools globally or per project. See [Tools](docs/settings.md#tools). - **Configurable fullscreen exit output** — Print the transcript or only a resume hint on exit. See [Interactive Mode](docs/usage.md#interactive-mode). ##### Added - Added fullscreen transcript search with `Ctrl+Shift+F`, incremental match highlighting, configurable search match theme colors, and next/previous navigation with `Enter`/`Ctrl+G` and `Shift+Enter`/`Ctrl+Shift+G`. - Added experimental strict JSON-schema constrained sampling for the default `read`, `bash`, `edit`, and `write` tools under `PI_EXPERIMENTAL=1`. - Added a fullscreen exit output setting to choose between printing the final transcript and only a session resume hint. - Added the `defaultTools` setting for configuring the initial built-in tool selection globally or per project. - Added `--use-theme <name[/name]>` to choose an initial per-run interactive theme without changing saved settings ([#​7722](earendil-works/pi#7722) by [@​rwachtler](https://github.com/rwachtler)). - Added `expandPromptTemplates` to extension `pi.sendUserMessage()` options for explicitly dispatching commands and expanding skills and prompt templates. See [`pi.sendUserMessage()`](docs/extensions.md#pisendusermessagecontent-options) ([#​7857](earendil-works/pi#7857) by [@​mrexodia](https://github.com/mrexodia)). - Added inherited `createGatewayBindingFetch()` for routing Cloudflare AI Gateway requests through a Workers AI binding without an API token ([#​7901](earendil-works/pi#7901) by [@​Maximo-Guk](https://github.com/Maximo-Guk)). - Added inherited `AssistantMessage.endTurn` to preserve OpenAI Codex's terminal `end_turn` signal for diagnostics ([#​7766](earendil-works/pi#7766)). - Added inherited unbound single-line transcript scrolling actions for fullscreen mode. See [TUI Fullscreen Viewport](docs/keybindings.md#tui-fullscreen-viewport) ([#​7903](earendil-works/pi#7903) by [@​midastruth](https://github.com/midastruth)). ##### Changed - Changed inherited Kimi Coding requests to use pi's runtime `User-Agent` header. - Replaced the inherited Mistral SDK transport with a native Chat Completions HTTP stream, eliminating its generated client and schema runtime overhead. - Documented the generic `AI_AGENT=pi` process marker and how it differs from `PI_CODING_AGENT=true` ([#​7747](earendil-works/pi#7747)). - Changed inherited OpenAI Responses deferred tool loading to prefer message-anchored `additional_tools` where supported while retaining tool-search and top-level fallbacks ([#​7709](earendil-works/pi#7709)). - Reduced inherited fullscreen rendering allocation churn by painting full-width layout rows directly instead of recompositing them on every frame. ##### Fixed - Fixed root Markdown files such as `README.md` and `AGENTS.md` in skill directories being reported as broken skills unless they declare valid skill frontmatter ([#​7805](earendil-works/pi#7805)). - Fixed single-object `edit` tool inputs failing validation by accepting them as one-edit arrays in both coding-agent and harness edit tools ([#​7835](earendil-works/pi#7835)). - Fixed managed-tool downloads delaying TUI startup and hiding diagnostics in fullscreen mode by mounting the TUI first and showing download progress and warnings inside it. - Fixed opening a model selector immediately after startup cancelling and restarting the in-progress model catalog refresh. - Fixed inherited GitHub Copilot login triggering API rate limits while enabling model policies by limiting concurrent policy updates ([#​6187](earendil-works/pi#6187)). - Fixed fullscreen transcript search snapping back to the current match during manual scrolling and fragmented mouse input leaking into the search query. - Fixed inherited required LaTeX arguments starting on a new line being parsed as empty ([#​7760](earendil-works/pi#7760)). - Updated the transitive `nanoid` development dependency to address a denial-of-service vulnerability. - Fixed fallback rendering for extension tool results to collapse long output and honor tool expansion ([#​7979](earendil-works/pi#7979)). - Fixed JSON and RPC `message_update` events dropping cumulative usage during streaming. See [JSON Event Mode](docs/json.md) and [RPC `message_update`](docs/rpc.md#message_update-streaming) ([#​7982](earendil-works/pi#7982) by [@​christianklotz](https://github.com/christianklotz)). - Fixed `pi.sendMessage(..., { triggerTurn: false })` steering an active run instead of only recording the custom message ([#​8022](earendil-works/pi#8022) by [@​cristinaponcela](https://github.com/cristinaponcela)). - Fixed the `defaultTools` setting dropping extension and SDK custom tools when selecting built-in defaults. - Fixed the subagent example rejecting YAML array syntax for the `tools` frontmatter field ([#​7598](earendil-works/pi#7598) by [@​alexsavio](https://github.com/alexsavio)). - Fixed the subagent example dropping parent session model, thinking, and tool configuration ([#​7897](earendil-works/pi#7897) by [@​virtuald](https://github.com/virtuald)). - Fixed custom system prompts concatenating the current working directory with later appended prompt content ([#​7887](earendil-works/pi#7887) by [@​distributedlock](https://github.com/distributedlock)). - Fixed inherited OpenAI Responses function and custom tool calls losing namespaces during streaming, proxying, and replay ([#​7709](earendil-works/pi#7709)). - Fixed inherited upstream request buffer failures not triggering automatic assistant retries. - Fixed inherited built-in and custom DeepSeek API models sending output limits through an unsupported field. - Fixed inherited Amazon Bedrock replay rejecting tool arguments that contain empty object keys while preserving all valid nested values ([#​7882](earendil-works/pi#7882) by [@​muyiyr](https://github.com/muyiyr)). - Fixed inherited DeepSeek compatibility detection for base URLs whose hostname contains uppercase letters ([#​7933](earendil-works/pi#7933) by [@​yearth](https://github.com/yearth)). - Fixed inherited Google Generative AI and Vertex AI responses with tool calls incorrectly treating output-limit or provider-error stops as normal tool use ([#​8059](earendil-works/pi#8059)). - Fixed inherited fullscreen mouse drag selection and OSC 8 link activation in terminals that report generic SGR mouse release button codes ([#​7963](earendil-works/pi#7963)). - Fixed inherited focused fullscreen overlays not receiving mouse wheel or viewport scroll keys such as PageUp and PageDown ([#​7894](earendil-works/pi#7894)). - Fixed inherited LaTeX control spaces split across line endings causing complete expressions to fall back to raw source. - Fixed split `Alt+Enter` input over SSH being misread as Escape, added `PI_TUI_ESC_TIMEOUT` for high-latency terminals, and limited that timeout to lone Escape input ([#​7899](earendil-works/pi#7899) by [@​powerfooI](https://github.com/powerfooI)). - Fixed inherited idle fullscreen sessions repainting and clearing text selection when the terminal loses focus ([#​7892](earendil-works/pi#7892) by [@​terrorobe](https://github.com/terrorobe)). - Fixed fullscreen selection copy to use the host clipboard and report failure instead of claiming success when OSC 52 is unsupported ([#​8110](earendil-works/pi#8110) by [@​Panoplos](https://github.com/Panoplos)). </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4zMS4wIiwidXBkYXRlZEluVmVyIjoiNDQuMzEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
1 task
XMoon
added a commit
to XMoon/dsh-pi-tui
that referenced
this pull request
Aug 22, 2026
The fullscreen drag selection and /copy flashed "Copied!" while a bare OSC 52 write silently left the system clipboard untouched under tmux (set-clipboard external), SSH chains without passthrough, and terminals that restrict OSC 52 (VTE, Terminal.app). - vendor: TuiAltScreenOptions gains a minimal copySelection callback seam (backported from the upstream earendil-works/pi#8110 structure); the returned boolean drives the Copied!/Copy failed flash, and the raw OSC 52 write stays the fallback for consumers without the callback - src/clipboard.ts: one shared copy policy — tmux load-buffer -w - with the text on stdin, then platform helpers (pbcopy / wl-copy / xclip / xsel / clip), then a TTY-gated OSC 52 best-effort fallback (inside tmux the sequence rides a DCS passthrough, kimi-code convention) - /copy routes through the same policy and reports success/failure truthfully - the execFile runner pipes the payload to the child stdin and survives early-exiting helpers (EPIPE) Closes #7
eleboucher
pushed a commit
to eleboucher/memini
that referenced
this pull request
Aug 28, 2026
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [@earendil-works/pi-tui](https://github.com/earendil-works/pi) ([source](https://github.com/earendil-works/pi/tree/HEAD/packages/tui)) | [`0.84.1` → `0.84.3`](https://renovatebot.com/diffs/npm/@earendil-works%2fpi-tui/0.84.1/0.84.3) |  |  | --- >⚠️ **Warning** > > Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/3) for more information. --- ### Release Notes <details> <summary>earendil-works/pi (@​earendil-works/pi-tui)</summary> ### [`v0.84.3`](https://github.com/earendil-works/pi/blob/HEAD/packages/tui/CHANGELOG.md#0843---2026-08-24) [Compare Source](earendil-works/pi@v0.84.2...v0.84.3) ##### Fixed - Fixed duplicate fullscreen right-click paste in VS Code-based terminals on Windows ([#​8186](earendil-works/pi#8186)). - Fixed padded text exceeding narrow terminal widths ([#​8252](earendil-works/pi#8252)). - Fixed wrapped Markdown table links leaking color into borders and neighboring cells, including tables inside blockquotes ([#​8335](earendil-works/pi#8335)). ### [`v0.84.2`](https://github.com/earendil-works/pi/blob/HEAD/packages/tui/CHANGELOG.md#0842---2026-08-14) [Compare Source](earendil-works/pi@v0.84.1...v0.84.2) ##### Added - Added unbound single-line transcript scrolling actions, `tui.altScreen.lineUp` and `tui.altScreen.lineDown`, for fullscreen TUI keybindings ([#​7903](earendil-works/pi#7903) by [@​midastruth](https://github.com/midastruth)). - Added incremental primary-scroll-view search to the fullscreen TUI with configurable match styles, `Ctrl+Shift+F`, and next/previous navigation with `Enter`/`Ctrl+G` and `Shift+Enter`/`Ctrl+Shift+G`. ##### Changed - Reduced alternate-screen per-frame allocation churn roughly 9-18x by painting full-width layout rows as direct line references instead of recompositing every visible row through ANSI/grapheme segmentation on each frame. ##### Fixed - Fixed fullscreen mouse drag selection and OSC 8 link activation in terminals that report generic SGR mouse release button codes ([#​7963](earendil-works/pi#7963)). - Fixed fullscreen transcript search snapping back to the current match during manual scrolling and fragmented SGR mouse input leaking into the search query. - Fixed required LaTeX arguments starting on a new line being parsed as empty ([#​7760](earendil-works/pi#7760)). - Fixed LaTeX control spaces split across line endings causing complete expressions to fall back to raw source. - Fixed focused fullscreen overlays not receiving mouse wheel or viewport scroll keys such as PageUp and PageDown ([#​7894](earendil-works/pi#7894)). - Fixed split `Alt+Enter` input over SSH being misread as Escape, added `PI_TUI_ESC_TIMEOUT` for high-latency terminals, and limited that timeout to lone Escape input ([#​7899](earendil-works/pi#7899) by [@​powerfooI](https://github.com/powerfooI)). - Fixed idle fullscreen sessions repainting and clearing text selection when the terminal loses focus ([#​7892](earendil-works/pi#7892) by [@​terrorobe](https://github.com/terrorobe)). - Fixed fullscreen selection copy falsely reporting success when OSC 52 is unsupported by allowing host clipboard integration and reporting verified failures ([#​8110](earendil-works/pi#8110) by [@​Panoplos](https://github.com/Panoplos)). </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - Between 12:00 AM and 03:59 AM, only on Monday (`* 0-3 * * 1`) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4zMS4wIiwidXBkYXRlZEluVmVyIjoiNDQuMzkuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19--> Reviewed-on: https://git.erwanleboucher.dev/eleboucher/memini/pulls/212
jinhuang712
pushed a commit
to jinhuang712/pi
that referenced
this pull request
Sep 11, 2026
…orks#8110) TuiAltScreen.copySelectionToClipboard() wrote a bare OSC 52 sequence and flashed "Copied!" unconditionally. Terminals that ignore OSC 52 clipboard writes (macOS Terminal.app, VTE terminals, tmux without OSC 52 passthrough) left the system clipboard untouched while the toast reported success. Add an injectable copySelection option to TuiAltScreenOptions (an async handler returning whether the copy succeeded) and use it when provided, falling back to the existing OSC 52 write otherwise. The coding agent now injects its native clipboard implementation (clipboard addon + pbcopy / wl-copy / xclip / xsel), so selection copy reaches the real clipboard and the toast only fires on verified success, with "Copy failed" otherwise. Closes earendil-works#7761 Co-authored-by: 富永 誠 <makoto@credify.one>
oskarfreye
pushed a commit
to draht-dev/draht
that referenced
this pull request
Oct 1, 2026
…orks/pi#8110) TuiAltScreen.copySelectionToClipboard() wrote a bare OSC 52 sequence and flashed "Copied!" unconditionally. Terminals that ignore OSC 52 clipboard writes (macOS Terminal.app, VTE terminals, tmux without OSC 52 passthrough) left the system clipboard untouched while the toast reported success. Add an injectable copySelection option to TuiAltScreenOptions (an async handler returning whether the copy succeeded) and use it when provided, falling back to the existing OSC 52 write otherwise. The coding agent now injects its native clipboard implementation (clipboard addon + pbcopy / wl-copy / xclip / xsel), so selection copy reaches the real clipboard and the toast only fires on verified success, with "Copy failed" otherwise. Closes earendil-works/pi#7761 Co-authored-by: 富永 誠 <makoto@credify.one>
qaworkfree
pushed a commit
to qaworkfree/pipipiPopopo
that referenced
this pull request
Oct 8, 2026
…orks#8110) TuiAltScreen.copySelectionToClipboard() wrote a bare OSC 52 sequence and flashed "Copied!" unconditionally. Terminals that ignore OSC 52 clipboard writes (macOS Terminal.app, VTE terminals, tmux without OSC 52 passthrough) left the system clipboard untouched while the toast reported success. Add an injectable copySelection option to TuiAltScreenOptions (an async handler returning whether the copy succeeded) and use it when provided, falling back to the existing OSC 52 write otherwise. The coding agent now injects its native clipboard implementation (clipboard addon + pbcopy / wl-copy / xclip / xsel), so selection copy reaches the real clipboard and the toast only fires on verified success, with "Copy failed" otherwise. Closes earendil-works#7761 Co-authored-by: 富永 誠 <makoto@credify.one>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TuiAltScreen.copySelectionToClipboard()wrote a bare OSC 52 sequence to the terminal and flashed "Copied!" unconditionally. Terminals that ignore OSC 52 clipboard writes (macOS Terminal.app, VTE-based terminals such as GNOME Terminal/Tilix, and tmux without OSC 52 clipboard passthrough) leave the system clipboard untouched while the toast reports success. This is the symptom reported in #7761 (and #7767, same cause on macOS Terminal.app).This PR makes the select-to-copy path go through the host application's real clipboard implementation, and only reports success when the copy actually happened.
Changes
packages/tui— add an injectablecopySelectionoption toTuiAltScreenOptions:copySelectionToClipboard()is nowasync. When a handler is provided it is awaited; the toast flashes"Copied!"only if the handler returnedtrue, and"Copy failed"otherwise."Copied!"), so the change is backward compatible for otherpi-tuiconsumers.packages/coding-agent—createInteractiveTuinow injects a handler backed bycopyToClipboard()(native clipboard addon, thenpbcopy/wl-copy/xclip/xsel, with OSC 52 as a last resort for remote sessions). This is the same verified-success path the/copycommand already used.Tests — added two cases in
tui-alt-screen.test.tscovering the injected-handler success and failure flash behavior, asserting no OSC 52 is emitted when a handler is provided.Why an injection point rather than importing the app's clipboard into pi-tui
pi-tuiis a renderer/library and shouldn't depend on the coding-agent's platform clipboard logic; keeping the native clipboard code in the app (where/copyalready owned it) avoids duplicating it and lets otherpi-tuiconsumers plug in their own implementation.Testing
packages/tui:tsgo -p tsconfig.build.jsonclean; tui suite passes including the 2 new tests.packages/coding-agent:tsgo -p tsconfig.build.jsonclean.Closes #7761