Project

General

Profile

Bug #11437

IO.pipe problem on windows console

Added by windwiny (wind winy) almost 4 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:<unknown>]

Description

# this code copy from Open3.popen3 
def mm(cmd)
  opts = {}

  in_r, in_w = IO.pipe
  opts[:in] = in_r
  in_w.sync = true

  out_r, out_w = IO.pipe
  opts[:out] = out_w


  pid = spawn(cmd, opts)
  wait_thr = Process.detach(pid)
  in_r.close
  out_w.close
  result = [in_w, out_r, wait_thr]

  result
end

mm('dir')

use ruby 2.0 or 2.2 (32bit windows) run this method in irb or pry,
return newline and input some chars, press backspace key can delete a char, but screen still show it

Also available in: Atom PDF