crystal icon indicating copy to clipboard operation
crystal copied to clipboard

io/console

Open dsisnero opened this issue 11 months ago • 2 comments

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

dsisnero avatar Mar 26 '24 00:03 dsisnero

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.

straight-shoota avatar Apr 22 '24 16:04 straight-shoota

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

philipp-kempgen avatar Apr 24 '24 05:04 philipp-kempgen