In Files

  • pty/shl.rb

Parent

Methods

Class/Module Index [+]

Quicksearch

Object

Public Instance Methods

writer() click to toggle source
 
               # File pty/shl.rb, line 20
def writer
  system "stty -echo raw"
  begin
    while true
      c = STDIN.getc
      if c == 26 then # C-z
        $reader.raise(nil)
        return 'Suspend'
      end
      $w_pty.print c.chr
      $w_pty.flush
    end
  rescue
    $reader.raise(nil)
    return 'Exit'
  ensure
    system "stty echo -raw"
  end
end