Implement IO::FileDescriptor
's console methods on Windows
#12294
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 implements
IO::FileDescriptor#noecho
,#cooked
,#raw
, plus their bang variants on Windows. For consistency it also adds#echo(&)
and#echo!
.samples\2048.cr
will now work properly on CMD, Windows Terminal, or Visual Studio Code's integrated terminal. Try it!The corresponding
Crystal::System::FileDescriptor#system_echo
and#system_raw
for Unix-like systems will be added in a follow-up PR, because they involve some less related breaking changes (making some methods returnnil
and deprecating the*_tc_mode!
macros).