submit composer input via tmux server, not the detached client PTY
test / unit + widget + golden + a11y (push) Failing after 28s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 30s

The composer sent input with pane.write, which writes to the PTY of the
tmux client the app spawned. That client detaches (we no longer render
or drain its PTY since T-137), leaving the session alive on the server
with no client — so keystrokes written to the dead PTY vanished and
Claude never saw the message.

Submit now goes through the tmux server: load the text into a named
paste buffer, paste it bracketed (multi-line and special chars arrive as
one block, not a stream of submits), then send Enter. Verified against a
live session — paste-buffer -p reaches Claude's input with no client
attached. The no-tmux fallback still uses pane.write (claude runs
directly in our PTY there).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-23 00:01:43 +02:00
co-authored by Claude Opus 4.7
parent 0abc14ed1a
commit 6910c79e5b
6 changed files with 48 additions and 6 deletions
+18
View File
@@ -54,3 +54,21 @@ Future<void> killAllForRepo(String primaryName) async {
}
}
}
/// Named tmux paste buffer clide loads composed messages into.
const _composeBuffer = 'clide-compose';
/// Submit [text] to [session] as a single message: load it into a named
/// paste buffer, paste it in bracketed mode (so multi-line content and
/// special characters arrive as one block rather than a stream of
/// submits), then press Enter.
///
/// This goes through the tmux *server*, so it reaches Claude whether or
/// not a client is attached. Writing to the app's spawned client PTY
/// (`pane.write`) does not — once that client detaches, the PTY is dead
/// and keystrokes vanish (the bug this replaces).
Future<void> sendMessage(String session, String text) async {
await tmuxRunner([..._socket, 'set-buffer', '-b', _composeBuffer, '--', text]);
await tmuxRunner([..._socket, 'paste-buffer', '-p', '-d', '-b', _composeBuffer, '-t', session]);
await tmuxRunner([..._socket, 'send-keys', '-t', session, 'Enter']);
}