Skip to content

fix(tmux): quick action prompts not submitted — trailing \n inside bracketed paste #264

@dgershman

Description

@dgershman

Bug

When clicking a quick action button (Merge PR, Address Changes, Fix Checks, Fix Conflicts), the prompt text is pasted into Claude Code's input but never submitted. Only affects the tmux backend.

Root Cause

TmuxBackend.sendText() uses paste-buffer to send text. When Claude Code has bracketed paste mode enabled, tmux wraps pasted content in \e[200~...\e[201~ escape sequences. The trailing \n inside the bracket is treated as literal text content, not as Enter. The Ghostty path works because it sends a synthetic Return keycode (36) outside any paste bracket.

Fix

Strip the trailing \n from the text before pasting via paste-buffer, then send a separate Enter key via tmux send-keys Enter after the paste completes.

Files to modify

  1. Packages/CrowTerminal/Sources/CrowTerminal/TmuxController.swift

    • Add sendKeys(target:keys:) method that runs tmux send-keys <key> -t <target>
  2. Packages/CrowTerminal/Sources/CrowTerminal/TmuxBackend.swift (~line 244, sendText)

    • Strip trailing \n from text before loading into paste buffer
    • After pasteBuffer, call ctrl.sendKeys(target:keys:["Enter"]) if the original text ended with \n

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions