Add a brief delay between terminal voice input text and the trailing newline, so that claude code doesn't interpret the newline as part of a paste

This commit is contained in:
James Babcock committed 2026-07-19 18:24:22 -07:00
1 parent 9b05c20c1b
commit 4401a4a416
2 files changed
+24 -3

No files matched your search

+4 -3
View File
@@ -124,10 +124,11 @@ global.onmessage = (event: { data: WorkerAppMessage }) => {
}
case "text-input": {
const window = windows.get(message.windowId);
// Only attached view windows have a terminal to type into. Append "\r"
// (the Enter key) so voice-dictated text is submitted as a command.
// Only attached view windows have a terminal to type into. submitInput
// appends Enter ("\r") after a wrapper-side pause so paste-detecting
// apps (e.g. Claude Code) submit instead of inserting a newline.
if (window && window.kind === "view") {
window.client.sendInput(`${message.text}\r`);
window.client.submitInput(message.text);
}
break;
}