Skip to content

fix(windows): type CR LF as one line break - #368

Merged
Railly merged 1 commit into
mainfrom
railly/type-crlf
Oct 31, 2026
Merged

Railly merged 1 commit into
mainfrom
railly/type-crlf

Conversation

@Railly

@Railly Railly commented Oct 31, 2026

Copy link
Copy Markdown
Member

Problem

On Windows, type posts each UTF-16 unit as its own Unicode SendInput event. CR and LF are each a line break on their own, so a CR LF pair typed two: line one\r\nline two landed with a blank line in between.

Changes

  • Post the CR alone when an LF follows it, in both chunking and the chunk-count preflight
  • A lone CR, a lone LF, and LF CR are posted unchanged
  • Tests for CR LF, lone breaks, and a CR LF split across a chunk boundary

Visual proof

type with line one\r\nline two\r\nline three into Notepad on Windows x64.

Before: a blank line after each line, cursor on Ln 5

After: three lines, cursor on Ln 3

Each Unicode CR or LF posted through SendInput is a line break on its own, so a CR LF pair typed two. Post the CR alone when an LF follows it.
@vercel

vercel Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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

1 Skipped Deployment
Project Deployment Actions Updated
agent-desktop Ignored Ignored Preview, v0 Oct 31, 2026 3:37am UTC

@Railly
Railly merged commit d77f910 into main Oct 31, 2026
24 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Issues and PR Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants