fix(tmux): drop leading line breaks from sendInput text

"\nfix it\r" pasted an empty first line. Leading line breaks are now
dropped like trailing ones. Document what useMux does with a line feed,
and that a pane without bracketed paste receives each pasted line break
as CR, so a multi-line write without \r runs every line but the last
there, where the old line-stripping typed the joined text and ran nothing.

Co-Authored-By: Christian Haberl <116439789+christianhaberl@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
committed 2026-10-21 08:03:54 +02:00
1 parent 3b747774f1
commit cf9511cb57
4 files changed
+27 -3

No files matched your search

+4
View File
@@ -434,6 +434,10 @@ about a hundred characters or more is taken as a paste by Claude Code, its `\r`
becomes a newline, and the prompt stays unsent (measured on 2.1.283). Any other
input (escape sequences, a bracketed-paste frame, a line feed, a bare `\r`) keeps
the raw write, and an explicit `"useMux": false` forces it.
With `"useMux": true`, a line feed is kept: the text goes in as one bracketed paste
(`\r\n` read as `\n`, leading and trailing line breaks dropped), then Enter if the
input carried a `\r`; a pane that has not enabled bracketed paste receives each line
break as a carriage return and runs the lines as they arrive.
```bash
curl -s -X POST "$API/api/v1/sessions/$SID/input" \