Repository navigation
Icod.Terminal 1.29.2
This patch corrects two Windows console setup defects exposed by live
qualification of an application using Icod.DCurses and Icod.Widgets.
UTF-8 console output
The default system-backed output transport writes the session's UTF-8 bytes to
the Windows console. Earlier releases enabled virtual-terminal processing but
left the console output code page unchanged. On an OEM code page, a single
box-drawing character such as ─ could therefore appear as several characters,
breaking retained cell geometry, popup borders and dialog placement.
A system-backed Windows session now acquires UTF-8 console-output decoding with
its virtual-terminal output lease. Setup captures the exact prior output code
page, changes it only when necessary, rolls back partial setup, and restores the
captured value on lifecycle release or final disposal. Lifecycle re-entry
reacquires the same requirements. Redirected output, explicit output services
and ConfigureOutput = false retain their existing caller-owned behavior.
Mouse input ownership
Windows Raw and CBreak input policy now enables virtual-terminal input,
ENABLE_MOUSE_INPUT, and ENABLE_EXTENDED_FLAGS, and clears Quick Edit while
the session owns the console. This prevents console text-selection policy from
consuming application mouse interaction. Raw continues to disable processed
input so Ctrl+C and Ctrl+Z can be application commands; CBreak continues to
retain processed-input behavior. Canonical mode remains unchanged. Session
cleanup restores the complete captured input mode, including unrelated flags.
Mouse protocol reporting remains explicit and reversible through
AcquireInputProtocolsAsync(...). The console-mode change makes that existing
lease dependable on Windows; it does not enable application mouse reporting by
itself and does not change the public input-event model.
Compatibility
There are no public API or production dependency changes. Existing callers do
not need source changes. Targets remain net8.0, net9.0, and net10.0.
See the compatibility policy.
Validation
Cross-target tests cover UTF-8 acquisition, unchanged UTF-8 baselines, setup
failure, idempotent disposal, exact code-page restoration, Raw/CBreak mouse
flags, Quick Edit suppression, unrelated-bit preservation and existing mode
restoration. The isolated Windows CI smoke uses a private native console to
verify:
- UTF-8 is active while the session owns byte-oriented output;
- writing
─produces one box-drawing screen cell; - Raw mode owns virtual-terminal and mouse input with Quick Edit disabled;
- Ctrl+C, Ctrl+Z, following input, Alt+F and Unicode remain intact; and
- the original input mode and output code page return after disposal.