Project

General

Profile

Bug #694

eof? call on a pty IO object causes application to exit

Added by pragdave (Dave Thomas) over 11 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
Backport:
[ruby-core:19583]

Description

=begin
dave[RUBY3/Book 18:08:15*] cat t.rb

require 'pty'

PTY.spawn("/usr/bin/ruby /usr/bin/irb") do |reader, writer, pid|
reader.eof?
end

dave[RUBY3/Book 18:08:52*] ruby -v t.rb

ruby 1.9.0 (2008-10-29 revision 15427) [i386-darwin9.5.0]
t.rb:4:in eof?': pty - exited: 82527 (PTY::ChildExited)
from t.rb:4:in
block in '
from t.rb:3:in spawn'
from t.rb:3:in
'

This problem prevents expect() from working.
=end

Also available in: Atom PDF