Skip to content

Add Windows console support - #140

Draft
nobu wants to merge 8 commits into
masterfrom
windows-console-support
Draft

Add Windows console support#140
nobu wants to merge 8 commits into
masterfrom
windows-console-support

Conversation

@nobu

@nobu nobu commented Aug 4, 2026

Copy link
Copy Markdown
Member

Summary

  • add IO#console_input_events with interruptible timeout support and expose Windows input event constants
  • add cross-platform cursor visibility methods and Windows output console mode accessors
  • add IO#input_pending? for non-consuming readiness checks
  • deprecate IO#check_winsize_changed, which discards unrelated console input records
  • implement the Windows APIs in the FFI backend so JRuby can use them without Reline's Fiddle implementation

Motivation

Reline currently implements several Windows console operations directly through Fiddle. Providing these operations in io-console gives console consumers one native abstraction across CRuby and JRuby, preserves input records while detecting resize events, and allows blocking console input waits to remain interruptible.

Validation

  • rake test with Ruby 4.0: 33 tests, 133 assertions
  • GitHub Actions across supported CRuby versions on Windows, macOS, and Linux, plus JRuby and TruffleRuby

nobu added 8 commits August 4, 2026 19:10
Preserve native console input event data for Windows consumers.
`IO#console_input_events` preserves records that the old size change
helper discards.
Add cross-platform cursor visibility operations so console users can
hide the cursor while redrawing without platform-specific code.
Expose virtual terminal processing and line wrapping flags so console
users can configure output without calling Win32 APIs directly.
Add `IO#input_pending?` so console users can detect queued input
without consuming it or relying on platform-specific APIs.
Add a `timeout` option to `IO#console_input_events` so callers can
wait for input while remaining responsive to Ruby interrupts.
Expose Windows input constants for console event consumers.
Let JRuby use Reline's native Windows path without Fiddle.
@nobu
nobu force-pushed the windows-console-support branch from 1d12f81 to 4f76df6 Compare August 4, 2026 10:11
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.

1 participant