CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

fix: macOS text injection breaks on newlines in transcription #4741

Merged⚡ AI-generatedXSccantynz wants to mergeclaude/scan-2mainopened Jun 13, 20260/3 tasks
ccantynzcommented Jun 13, 2026

Originally written by @ccantynz-alt on GitHub.
Imported from https://github.com/ccantynz-alt/voxlen/pull/60


Summary

  • macOS text injection (src-tauri/src/text_injection/mod.rs): simulate_keyboard embedded text in an AppleScript keystroke "..." string without handling newlines. A newline in transcription text (e.g. from a voice command "new line") would produce invalid AppleScript and silently fail to inject. Fixed by splitting on \n and sending key code 36 (Return) between segments.

Test plan

  • Dictate text containing "new line" voice command — text injected with actual newline into target app on macOS
  • Dictate plain text without newlines — still injects correctly
  • Trailing newline in text (e.g. "new paragraph" producing \n\n) — two Returns sent, no crash

Generated by Claude Code

ccantynzcommented Jun 13, 2026

Originally written by @vercel[bot] on GitHub.


The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
voxlen Ready Ready Preview, Comment Jun 13, 2026 8:00am

Cross-repo impact

See what breaks downstream if this PR merges.

Analyze →
⮌ Merged

This pull request was merged into main.

c comment · e edit title · m merge · a approve · r request changes · ? shortcuts