orca icon indicating copy to clipboard operation
orca copied to clipboard

[Bug]: Windows: paste preview collapses long text to tail only; "paste again to expand" repeats same fragment instead of expanding

Open taifunk opened this issue 5 months ago • 3 comments

Operating system: Windows Orca version: v1.4.68

Short summary

On Windows, pasting a long multi-paragraph block into an Orca terminal shows only the tail of the text in a collapsed preview. The hint paste again to expand appears, but pressing Ctrl+V a second time appends the same tail fragment instead of expanding to the full clipboard content. The full text never reaches the foreground program.

What happened

  1. Copied a long multi-paragraph block (~500+ chars, ~20 lines) to the clipboard.
  2. In an Orca terminal running Claude Code, pressed Ctrl+V.
  3. Orca showed a collapsed paste preview — only the last few lines of the text appeared in the terminal input, with two hints at the bottom of the pane:
    • paste again to expand (left)
    • ctrl+g to edit in Notepad (right)
  4. Pressed Ctrl+V again (the "paste again to expand" action).
  5. The same tail fragment was appended a second time — no expansion to full text. Claude Code received [tail][tail], not the full clipboard content.

How to reproduce

  1. Windows, Orca v1.4.68.
  2. Open a terminal and run claude (Claude Code CLI).
  3. Copy any long multi-paragraph text block (~500+ chars) to the clipboard.
  4. With Claude idle at its prompt, press Ctrl+V.
  5. Observe: paste preview shows only the tail; hints paste again to expand and ctrl+g to edit in Notepad appear at the bottom of the pane.
  6. Press Ctrl+V again.
  7. Observe: the same tail is appended again — full text is never sent.

Evidence — direct comparison, same machine, same clipboard, same CC version

Terminal Claude Code input after paste
Windows Terminal Full prompt received — all paragraphs visible
Orca v1.4.68 Tail only received; second paste appends same tail again

The only variable is the terminal. This conclusively places the bug in Orca's paste preview layer.

Relationship to PR #5291 / issue #5274

PR #5291 ("Fix Windows multiline terminal paste", ships in v1.4.68) fixed the earlier "each line submitted separately" regression from #5274 via forceBracketedMultilineTextPaste = isWindowsUserAgent(). That code path appears correct in source.

However, the paste preview/collapse UI — the layer that shows the collapsed tail and the paste again to expand / ctrl+g to edit in Notepad hints — is a separate code path that does not correctly deliver the full clipboard content. PR #5291 did not cover this layer.

Workaround

ctrl+g to edit in Notepad (the right-side hint in the paste preview bar) gives access to the full clipboard text for editing before submission. Windows Terminal also works reliably for long pastes.

Environment

  • Orca v1.4.68 (Windows)
  • Windows 10 Pro (22H2 / 19045)
  • Claude Code v2.1.177
  • PowerShell 7+

taifunk avatar Jun 14 '26 14:06 taifunk

Retested the Orca paste-transport boundary on Windows against current main at 506f6ffbb (Orca 1.4.133). I could not reproduce truncation or duplicate delivery before the foreground program.

Using a real isolated Electron/ConPTY session and an actual Ctrl+V keyboard event, I pasted a roughly 1.9 KB / 30-line payload containing a unique head and tail, Windows paths, shell metacharacters, Unicode, and mixed LF/CRLF line endings. The PowerShell PTY received the complete payload byte-for-byte exactly once. The equivalent WSL terminal coverage also passed with exact content and one PTY owner.

This is meaningful because later work after v1.4.68 consolidated terminal paste ownership and added this Windows regression coverage. It rules out the current generic clipboard → xterm → PTY path dropping the head or sending only the tail.

Remaining gap: I have not reproduced the Claude Code collapsed-preview UI itself, so this does not prove the second-paste expansion behavior inside Claude is fixed. Could you retest with Orca 1.4.133+ and a current Claude Code (the Windows host used here has 2.1.206), then report:

  • whether the first preview still contains only the tail;
  • whether the second Ctrl+V expands or appends;
  • whether it happens in a plain PowerShell terminal before launching Claude;
  • whether terminal bracketed-paste mode is active ($env:TERM plus the Claude version is enough; please do not share clipboard contents).

If it still reproduces only in Claude, I can add an isolated Claude-TUI regression around the exact preview transition next.

OrcaWin avatar Jul 10 '26 20:07 OrcaWin

Follow-up with the previously missing live Claude UI coverage: I ran the issue's exact two-paste transition on Windows against origin/main (506f6ffbb, Orca 1.4.133) with authenticated Claude Code 2.1.206.

Test details:

  • visible/headful Orca + real ConPTY;
  • synthetic 1,771-character, 26-line clipboard payload with unique head and tail markers;
  • native Windows Ctrl+V delivered only after verifying Orca's exact HWND owned foreground focus;
  • prompt was never submitted (Claude was interrupted after observation).

Observed:

  1. First Ctrl+V rendered Claude's collapsed preview with paste again to expand; neither the unique head nor tail was visible, as expected for the collapsed state.
  2. Second Ctrl+V expanded the preview to all 26 lines. The unique head and tail were both present exactly once, and the expansion hint disappeared.
  3. The PTY write trace contained two complete bracketed-paste payloads—the repeat Claude uses to recognize the expand action—not duplicated tail fragments.

Result: 1/1 passed. I cannot reproduce the v1.4.68 bug on current main/current Claude, including the actual collapsed-preview/second-paste UI that my earlier transport-only comment left open. A reporter retest on 1.4.133+ would confirm this outside the isolated E2E profile.

OrcaWin avatar Jul 10 '26 21:07 OrcaWin

Closing as fixed on current Orca/Claude. The exact live Windows transition passed on Orca 1.4.133 with Claude Code 2.1.206: the first Ctrl+V showed the collapsed preview, the second expanded the complete 1,771-character/26-line payload, and the unique head/tail appeared exactly once without duplicated fragments.

If this returns on a newer version, please open a new issue referencing #5358 with the Orca and Claude versions and whether the second paste expands or appends. Do not include clipboard contents.

OrcaWin avatar Jul 10 '26 23:07 OrcaWin