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

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -