watchexec / watchexec/clearscreen
is_windows_10 documentation somewhat incorrect
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 81
- Forks
- 9
- Avg merge
- 7h 32m
- Merged PRs (30d)
- 2
Description
Hi! Windows Console Subsystem maintainer here :)
is_windows_10 is documented implying that you cannot use ENABLE_VIRTUAL_TERMINAL_PROCESSING without first checking that you're on Windows 10, and goes to great lengths to explain how versioning is handled.
None of that is strictly necessary! If you call SetConsoleMode(..., ENABLE_VIRTUAL_TERMINAL_PROCESSING) and the console host does not support it, regardless of the version of Windows, it will give you a status code and ignore you.
I know we haven't made this very easily discoverable. Sorry :/.
That means you can collapse all your version checking logic into "does the console host support VT processing?" In so doing, you get is_microsoft_terminal for free (since it does support VT processing) and the handful of custom console hosts that exist for Windows 8 which also support VT processing. You can collapse every micosoft_terminal and Windows case to "get mode, check VT_PROCESSING, try to set it, bail out[^1] if it's rejected."
To put a finer point on it... here's a console on Windows 8.1 displaying Sixels, a nominally "Windows 11+" feature which requires VIRTUAL_TERMINAL_PROCESSING (side by side with one that doesn't support that mode!)
[^1]: bail out and do it the legacy way, FWIW.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the documentation for is_windows_10 and compare its version-checking guidance with the described SetConsoleMode capability check. Update the documentation to explain capability detection and the legacy fallback, then verify that the resulting guidance covers supported and unsupported console hosts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100