Skip to content

Fix legacy Alt keys and Windows Ctrl+Z input for 1.29.1 - #88

Merged
uniblab merged 7 commits into
mainfrom
fix/1.29.1-terminal-menu-input
Oct 15, 2026
Merged

uniblab merged 7 commits into
mainfrom
fix/1.29.1-terminal-menu-input

Conversation

@uniblab

@uniblab uniblab commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

The Icod.Widgets menu gallery exposed two transport problems: legacy Alt+F was decoded as Escape followed by ordinary text, and Windows console stream reads could interpret Ctrl+Z as EOF even in raw mode. That prevented menu activation and exited the editor instead of undoing.

This patch decodes legacy Alt characters within the existing bounded escape window while preserving control-family recovery. Windows process input now uses an owned ReadConsoleW handle, preserving Ctrl+C, Ctrl+Z, and Unicode, converting UTF-16 incrementally to UTF-8, and completing canceled reads before closing the handle. Process console encodings are unchanged.

The application-shortcut API is explicit and cross-platform: open the session with TerminalSessionOptions.InputMode = TerminalInputMode.Raw, then consume Ctrl+C and Ctrl+Z through ReadEventAsync(...) as TerminalKey.Character events with the Control modifier and characters C and Z. CBreak deliberately preserves POSIX SIGINT/SIGTSTP and Windows processed-input behavior. No separate signal-interception API is required.

Version is 1.29.1. No public API or production dependency changes. README remains capability-focused and records the raw-control-key contract plus owned Windows console path. The permanent input guide defines raw versus cbreak behavior, legacy Alt decoding, and Windows handle ownership. The Rich Input sample deliberately uses raw mode and walks through Alt+F, Ctrl+C, and Ctrl+Z. CHANGELOG and curated release notes carry the complete release history.

Validation:

  • The full solution builds in Staging with zero warnings.
  • 2,934 tests pass for each target framework (8,802 total), plus 15 terminfo integration tests per framework (45 total); local net8/net9 execution uses runtime roll-forward to .NET 10.
  • Decoder tests prove consecutive Ctrl+C and Ctrl+Z decode as Control-modified Character keys and that following input continues.
  • The real Unix PTY smoke passes both CBreak and Raw on net8.0, net9.0, and net10.0; Raw injects literal 0x03/0x1A and proves Ctrl+C/Ctrl+Z delivery, continued input, cancellation, restoration, and reopen.
  • Windows transport tests cover Ctrl+C, Ctrl+Z, split surrogates, single-byte buffers, cancellation/reuse, and disposal.
  • The separate-process native Windows console CI smoke injects Ctrl+C, Ctrl+Z, following text, Alt+F, Unicode, and shutdown with a pending console read.
  • The raster hardening test now resolves the deliberately simulated late acknowledgement before starting its short-timeout retry, removing a Windows scheduling race without changing production behavior.
  • The Rich Input sample builds on all targets. Local package validation confirms version 1.29.1, all three target assemblies, embedded README, curated-note and compatibility links, and expanded NuGet release notes.
  • A real Linux PTY run of the Widgets gallery with this assembly passed Alt+F, Undo/Redo, cascading menus, Escape, and exit.

Windows/Linux/macOS runtime and integration jobs, package contract shards, package artifacts, native Windows input, and compatibility sample acceptance all pass in CI run 38811982909 on ce56b3bed42586972896da849fa8439e23465fec.

Companion to uniblab/Icod.Widgets#12. Publish this patch before updating the Widgets/DCurses dependency chain and repeating the owner Windows gallery test.

Do not merge or publish automatically.

@uniblab uniblab self-assigned this Oct 15, 2026
@uniblab
uniblab merged commit 13e0914 into main Oct 15, 2026
10 checks passed
@uniblab
uniblab deleted the fix/1.29.1-terminal-menu-input branch October 15, 2026 22:01
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