crystal
crystal copied to clipboard
io/console
Feature Request
-
Need a cross-platform way to provide tty, console behavior
-
Ruby has an io/console io/console
docs class that abstracts the different platform differences into a common library . methods like winsize, getch, raw, etc -
most of the terminal tui, type libraries don't work on windows because they assume termbox or termios libraries.
provide io/console or something similar
Some of the features that io/console
provides are already part of IO::FileDescriptor
in Crystal by default.
More advanced features for building terminal user interfaces probably fit best in a shard.
If a mature library is available we can consider incorporating it into the standard library if necessary.
I don't think there's any actionable here for this repo.
Regarding winsize
: issue #2061
Regarding raw
, there's IO::FileDescriptor#raw{}
and #raw!
- https://crystal-lang.org/api/1.12.1/IO/FileDescriptor.html#raw%28%26%3Aself-%3E_%29-instance-method
- https://crystal-lang.org/api/1.12.1/IO/FileDescriptor.html#raw%21%3ANil-instance-method