Ruby, STDIN, and Curses -
i'm trying take input stdin in same script i'm using curses. causes ruby exit , never draw curses on page.
the following works fine:
require 'curses' curses.init_screen begin curses.setpos(6, 3) # column 6, row 3 curses.addstr("hello") curses.getch # wait until user presses key. ensure curses.close_screen end but if run with, example ls | example.rb, fails immediately, if consume stdin stdin.read.
i have tried stripping stdin.read, , tried solutions how test filter-like ruby scripts pry? no luck.
Comments
Post a Comment