Skip to content

[Enhancement] Show paste content preview in input placeholder before submission #28687

Description

@mikegilchrist

Describe the feature

When multi-line content is pasted into the Claude Code input buffer, it is replaced with a placeholder such as:

[Pasted text #1 +22 lines]

This confirms that a paste occurred and how many lines were received, but provides no way to verify which content was captured. Users cannot confirm the correct text was pasted without submitting the message first.

Requested behavior: expand the placeholder to include a truncated preview of the first and last lines:

[Pasted text #1 +22 lines | "Exams/1/exam.1_2022_intro..." ... "evince Doolittle_2017...pdf &"]

Why this matters

  • Multi-line pastes are opaque: the line count alone does not confirm the right content was captured
  • Clipboard state in complex desktop environments (multiple clipboards, clipboard managers, tmux buffers) is often ambiguous -- users frequently are not certain which buffer was pasted
  • There is no way to inspect paste content before committing to submission

Current behavior

Placeholder shows only line count. User must submit to see what was received.

Expected behavior

Placeholder shows line count plus first ~60 chars of the first line and last ~60 chars of the last line, giving enough context to verify the paste without submitting.

Implementation note

Claude Code already intercepts paste events to generate the placeholder -- the content is available at that point. The proposed change is additive: extract the first and last lines from the already-captured paste buffer and include them in the placeholder string. No new mechanism is required.

Related issues

Platform

Linux (confirmed), likely affects all platforms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:tuiduplicateThis issue or pull request already existsenhancementNew feature or requestplatform:linuxIssue specifically occurs on LinuxstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions