basecamp / thruster

MIT License
912 stars 31 forks source link

Set `stdin` in `UpstreamProcess` to `os.Stdin` (instead of `/dev/null`) #18

Closed 3v0k4 closed 7 months ago

3v0k4 commented 7 months ago

Fixes #16

As explained in the issue, debug depends on irb, which depends on reline. There's a call to @@input.winsize in reline:

  def self.get_screen_size
    s = @@input.winsize
    return s if s[0] > 0 && s[1] > 0
    s = [ENV["LINES"].to_i, ENV["COLUMNS"].to_i]
    return s if s[0] > 0 && s[1] > 0
    [24, 80]
  rescue Errno::ENOTTY
    [24, 80]
  end

The above fails because thruster uses /dev/null as stdin:

$ irb

STDIN.winsize
 => [39, 172]

devnull = File.open(File::NULL, "w")
devnull.winsize
(irb):3:in `winsize': Operation not supported by device - /dev/null (Errno::ENODEV)