Open
Conversation
b3399d1 to
14ebd22
Compare
This PR adds support for running nocterm applications on Windows: ## Changes ### stdio_backend.dart - Add Windows-specific resize detection using polling (250ms interval) since SIGWINCH is not available on Windows - Initialize resize and shutdown stream controllers for all platforms - Add SIGINT handling for Ctrl+C on Windows - Add _windowsResizeTimer and _lastKnownSize fields for polling ### app.dart - Add cross-platform keyboard input parsing via _parseKeyInput() - Support Windows extended key codes (0xE0 prefix for arrow keys) - Support Windows carriage return (0x0D) for Enter key - Support Windows backspace (0x08) - Support both Unix ANSI sequences and Windows Terminal ANSI variants ## Testing Tested on Windows 11 with Windows Terminal - the app renders correctly and keyboard input is properly handled. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Windows doesn't send arrow keys and other special keys through stdin - they require the Windows Console API (ReadConsoleInput). This commit adds: - win32_ansi_stdin.dart: FFI wrapper for Windows Console API that: - Uses ReadConsoleInput to capture keyboard events - Translates Windows virtual key codes to ANSI escape sequences - Supports arrow keys, function keys, navigation keys - Handles modifier keys (Ctrl, Alt, Shift) - Provides mouse input translation to SGR format - Updates stdio_backend.dart to use Win32AnsiStdin on Windows - Adds ffi dependency for native memory allocation This enables TUI applications like vide to receive proper keyboard input on Windows, including arrow keys for cursor movement. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
14ebd22 to
a1b06e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for running nocterm applications on Windows:
Changes
stdio_backend.dart
app.dart
Testing
Tested on Windows 11 with Windows Terminal - the app renders correctly and keyboard input is properly handled.
🤖 Generated with Claude Code