Skip to content

feat: implement legacy console API on Windows#16

Merged
the-mikedavis merged 1 commit intohelix-editor:masterfrom
aschey:input-records
Feb 25, 2026
Merged

feat: implement legacy console API on Windows#16
the-mikedavis merged 1 commit intohelix-editor:masterfrom
aschey:input-records

Conversation

@aschey
Copy link
Copy Markdown
Contributor

@aschey aschey commented Jan 19, 2026

This adds support for the legacy console API in Windows, in addition to the VTE protocol that's used currently. Since more advanced key combos will only work for terminals that implement the Kitty Keyboard Protocol when using VTE mode, there unfortunately doesn't seem to be a clear answer on which input method is better. Windows Terminal, notably, does not implement this, so Windows users who prefer Windows Terminal will likely prefer using the legacy protocol until Microsoft adds it (tracking issue). I've added a section in the README with a comparison table, although I'm sure there are additional differences that I'm not aware of.

Because of this, I made the input mode configurable at runtime by using PlatformTerminal::with_mode instead of making this purely a compile-time switch. The legacy protocol is still gated behind a feature flag (windows-legacy), however, so users who don't need it won't pay for the additional compilation time. I've updated the event-read example to demonstrate this.

The implementation is almost entirely taken from crossterm, with a few tweaks made so it fits in with the current API. I've updated the credit comments accordingly.

A few other changes were necessary here:

  • Some of the additional windows-sys code required windows-sys 0.60, so I had to update the version requirement
  • windows-sys 0.60 has an MSRV of 1.71, so I had to bump that as well.

Copy link
Copy Markdown
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks sweet, thanks for spending the time diving into it! I'm glad to see everything ported over to windows_sys. At a very quick scan through I think everything looks good but I will try to give this a closer look and some Windows testing in the coming days 👍

@aschey
Copy link
Copy Markdown
Contributor Author

aschey commented Feb 17, 2026

Side note, but it looks like kitty keyboard protocol support just got merged in to Windows Terminal. Hopefully that means there won't be a good reason to recommend using the legacy input protocol for too much longer.

Copy link
Copy Markdown
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I finally booted onto Windows and gave this a test and it works great! Thanks for porting all of this stuff over to windows-sys.

We're shooting to make a release for Helix in early March but then soon after I'll move Windows back onto termina and force the legacy mode. Once the VTE stuff is mature enough we can add a config flag to control which one you use - being able to choose at config time rather than at build time seems like the right way to expose this to me 👍

@the-mikedavis the-mikedavis merged commit 3bcfbb4 into helix-editor:master Feb 25, 2026
9 checks passed
@aschey aschey deleted the input-records branch February 26, 2026 04:17
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