title: Ruby on Linux PTY goes away without EOF, raises Errno::EIO
body: <p>I'm writing some code which takes a file, passes that file to one of several binaries for processing, and monitors the conversion process for errors.  I've written and tested the following routine on OSX but linux fails for reasons about which I'm not clear.</p>
  
  <pre><code>#run the command, capture the output so it doesn't display
  PTY.spawn(command) {|r,w,pid|
      until r.eof? do
        ##mark
        puts r.readline
      end
  }
  </code></pre>
  
  <p>The command that runs varies quite a lot and the code at the ##mark has been simplified into a local echo in an attempt to debug the problem.  The command executes and the script prints the expected output in the terminal and then throws an exception.</p>
  
  <p>The error it produces on Debian systems is:  <code>Errno::EIO (Input/output error - /dev/pts/0):</code></p>
  
  <p>All of the command strings I can come up with produce that error, and when I run the code without the local echo block it runs just fine:</p>
  
  <pre><code>PTY.spawn(command) {|r,w,pid|}
  </code></pre>
  
  <p>In either case the command itself executes fine, but it seems like debian linux isn't sending eof up the pty.  The doc pages for PTY, and IO on ruby-doc don't seem to lend any aid here.</p>
  
  <p>Any suggestions?  Thanks.</p>
  
  <p>-vox-</p>