$stdin.getchar/STDIN.getchar when executed rubymine throws an Invalid Argument error
I tried using $stdin.getchar in one of my programs and Rubymine continually throws the following error.
Uncaught exception: Invalid argument
############################ .rb:4:in `getch'
############################getch.rb:4:in `<top (required)>'
The above error was thrown simply by executing
require 'io/console'
puts "Press any key"
input = $stdin.getch
running the code on the command-line or typing in irb poses no problem. Has anyone seen this or can recreate the issue?
请先登录再写评论。
Hello, David,
sorry for the delay. The reason why you get this error is that we don't have support for tty, please vote for the corresponding request on our tracker:
https://youtrack.jetbrains.com/issue/RUBY-11576