From: Massimiliano Mirra Date: 2002-03-04T07:44:34+09:00 Subject: Readline loses stdin? When I run the following code... require 'readline' first_line = Readline.readline oldin = $stdin $stdin = File.open(".bash_profile") $stdin.close $stdin = oldin second_line = Readline.readline ...I get something unexpected. $ ruby problem.rb this is the first line readline: warning: rl_prep_terminal: cannot get terminal settingsroot:x:0:0:root:/root:/bin/bash Between reading the first and the second line, I'm trying to have the program read from a file as it were its standard input, then close the file and restore things as they were, then finally reading a second line. Apparently, I'm missing something. Anybody has any idea of what is going on? Massimiliano