Skip to content

[Bug] Bracketed paste only works in the main prompt, every other text field in the app silently receives nothing #1456

Description

@addyCooks

Description

cli.tsx enables bracketed paste (DECSET 2004) for the whole interactive session and strips each pasted payload out of the raw stdin stream before Ink ever sees it, re-emitting it on a singleton pasteEvents bus instead. Exactly one component in the entire codebase subscribes to that bus: the main composer (UserInput). Every other text field the MCP setup wizard, settings panels, the ask_user prompt, the architect review's revise-instructions box receives neither the paste event (nothing subscribes) nor the raw keystrokes (they were already stripped out at the source), so a paste into any of them is silently discarded.

Parent: #907

Steps to Reproduce

  1. Run /settings mcp → "Configure MCP Servers" → "+ Add an MCP server…" → accept the default config location → "Add MCP servers" → scroll down and select "Custom MCP Server".
  2. Accept the default transport (Field 1/6) to reach "Server name" (Field 2/6).
  3. Paste any text into the field.

Expected Behavior

The pasted text appears in the field, the same way it would in the main composer.

Actual Behavior

Nothing appears. The field stays completely empty no text, no error, no indication the paste was even received.

Recording

Image

Root Cause

source/utils/terminal-paste.ts:45: /** Singleton bus: cli.tsx publishes payloads, UserInput subscribes. */ and indeed, a repo-wide search for pasteEvents turns up exactly one subscriber, source/components/user-input.tsx:304-306 (pasteEvents.on('paste', handleTerminalPaste) / the matching .off on cleanup). Every other TextInput-based field in the codebase wizards/steps/mcp-step.tsx, wizards/steps/field-input-view.tsx, components/question-prompt.tsx, components/architect-review-prompt.tsx, the app/components/settings-*.tsx panels, components/json-viewer/json-viewer.tsx has no path to receive a paste at all, because cli.tsx already removed the payload from the stream before any of them could see it as ordinary keystrokes.

Suggested Fix

Move the paste subscription into the shared TextInput component (or a small hook it uses) so every text field receives payloads by default, instead of wiring it into one specific composer component.

Additional Context

  • I have searched existing issues to ensure this is not a duplicate
  • I can reproduce this issue consistently
  • This issue occurs on the latest main

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:tuiTerminal UIbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions