feat(cli): native Windows console editing (raw-mode stub today)
I maintainer di solito rispondono entro 10 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- zig
- Ambito
- cli
Direzione di ricerca
Start with src/channels/cli.zig and src/channels/cli_line_editor.zig, then read the existing CliRawMode implementation and the POSIX backend to understand the shared surface. Implement the Windows console backend while keeping the WASI stub unchanged; add a Windows-only test for mode restoration and console width. Done means the CLI/history suites and 12 line-editor tests pass on Windows, alongside the specified Windows smoke test and formatting check.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Source
The third non-blocking follow-up named in the approval on #970:
Native Windows console editing remains an explicitly documented follow-up.
#1028 deliberately scopes this out ("Out of scope: native Windows console editing") and does not track it, so this issue exists to give it a home. #970 has since merged as f239fa1c, so the code this targets is on main and this can be implemented directly against it.
Problem
supportsRawMode() returns false on Windows and WASI, and CliRawMode compiles to a stub whose enable/suspendProcess/quitProcess all return error.NotSupported, whose waitForEscapeContinuation hardcodes false, and whose terminalColumns hardcodes DEFAULT_TERMINAL_COLUMNS (80).
The result is that the interactive line editor introduced by #970 — arrow-key movement, history recall, debounce coalescing, incremental escape parsing — is effectively POSIX-only. On Windows the CLI cannot enter raw mode, so it falls back to plain line reading: no cursor editing, no multiline history recall, a fixed 80-column assumption, and no suspend/resume path.
The stub is a deliberate and correct fail-fast boundary (AGENTS.md §3.4 keeps unsupported paths explicit rather than silently wrong). This issue is about giving Windows real console support, not about changing the stub's behaviour in the meantime.
Proposed
- Implement a Windows console backend behind the same
CliRawModesurface, so the editor is portable without conditional logic at the call sites:enable/disableviaSetConsoleMode(ENABLE_ECHO_INPUT,ENABLE_VIRTUAL_TERMINAL_INPUT,ENABLE_PROCESSED_INPUT), restoring the original modes on exit.terminalColumnsviaGetConsoleScreenBufferInfo, replacing the hardcoded 80.waitForEscapeContinuationusingWaitForSingleObjectwith the existingESCAPE_SEQUENCE_TIMEOUT_MSbudget, keeping escape parsing behavior identical across platforms.suspendProcess/quitProcessmapped to the Windows equivalents (SetConsoleCtrlHandler/GenerateConsoleCtrlEvent).
- Keep the WASI stub as-is unless WASI gains a console API; it is a different problem from Windows.
- Preserve the existing contract that suspend/resume behavior is symmetric — termios restore on POSIX, mode restore on Windows.
Test plan
- Windows-only, CI-gated: a console test that enters and exits raw mode, asserts
ENABLE_ECHO_INPUTis cleared inside and restored after, and assertsGetConsoleScreenBufferInforeports the real width rather than 80. - Cross-platform parity: the 12 standalone
cli_line_editor.zigtests and the CLI/history suites must pass unchanged on Windows, which is the strongest signal that the backend is behaviorally equivalent. zig build test --summary all(0 failures, 0 leaks) on both Linux and Windows runners;zig fmt --check src/.- Manual interactive pass on Windows for arrow keys, history recall, resize, and Ctrl-C/Ctrl-Z, mirroring the POSIX smoke test.
Scope / risk
- High risk (
src/channels/cli.zig,src/channels/cli_line_editor.zig) — interactive input path, and the only place in the CLI that is platform-conditional. - Interactive rendering and signal behavior cannot be established by unit tests alone; the OS-level smoke test is part of the deliverable, not optional. The approval on #970 explicitly noted that signal/resize behavior was "inspected in code, not claimed as an OS-level smoke test" — this work should close that gap for Windows rather than repeat it.
- A POSIX-side PTY smoke test of the merged editor has since been run (see #1028) and passed on every path except the known resize-sampling issue; a matching Windows harness should be the acceptance bar here.
- Code change, so tracked separately from #970 (now merged).
- Lingua principale
- Zig
- Stelle
- 8.1k
- Fork
- 945
- Merge medio
- 7g 6h
- PR unite (30g)
- 7
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nullclaw/nullclaw
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
nullclaw/nullclaw#1078 · 2 commenti ·
I maintainer di solito rispondono entro 10 giorni
-
ci: gate Docker image changes on PRs and before release publishForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 10 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
nullclaw/nullclaw#993 · 1 commento ·
I maintainer di solito rispondono entro 10 giorni
-
Difficoltà 4/5 Più di una settimana Idoneità per principianti 12/100
I maintainer di solito rispondono entro 10 giorni
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
nullclaw/nullclaw#1055 · 3 commenti ·
I maintainer di solito rispondono entro 10 giorni
Tutte le issue di nullclaw/nullclaw
Issue simili
-
test(data-root): the code-root path check does not treat config/ as user dataForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertafirst-timers-only good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
career-ops-hq/career-ops#6262 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Git-Hospital/githealthcheck#60 ·
I maintainer di solito rispondono entro 1 giorno
-
area:cli bug dotnet good first issue priority:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
rtk-ai/rtk#4844 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Results from sources can contain invalid host namesForse già presa @Mzack9999 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
projectdiscovery/subfinder#1983 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
cargo-bins/cargo-binstall#2725 ·
I maintainer di solito rispondono entro 1 giorno