From: Tanaka Akira Date: 2013-10-31T09:48:40+09:00 Subject: [ruby-core:58091] Re: [ruby-trunk - Bug #9067][Open] IO.reopen broken in 1.9/2.0, worked in 1.8 2013/10/31 walles (Johan Walles) : > Bug #9067: IO.reopen broken in 1.9/2.0, worked in 1.8 > https://bugs.ruby-lang.org/issues/9067 > ./reopen-fail.rb:8:in `reopen': can't change access mode from "r" to "w" (ArgumentError) > from ./reopen-fail.rb:8:in `
' > > AFAICT this makes it impossible to write Curses programs in Ruby that can accept input through pipes with newer versions of Ruby. I recommend $stdin.reopen(IO.new(1, "r+")) or $stdin.reopen("/dev/tty") instead of $stdin.reopen($stdout) -- Tanaka Akira