Project

General

Profile

Actions

Bug #18657

closed

IRB raises exception when stdout is a pipe

Added by pjones (Peter Jones) almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.2.0dev (2022-03-24T16:14:55Z master 33b13bd9f1) [x86_64-linux]
[ruby-core:108054]

Description

When piping stdout to another process IRB fails:

lib/ruby/3.0.0/irb/input-method.rb:42:in `winsize': Inappropriate ioctl for device (Errno::ENOTTY)

For example:

echo n=1 | irb | cat

This bug was introduced in e468d9f49ca34f713c030c623f655a40370e186d and triggered by 8f9b1902f48b413bd161666630c878ad58418c04 and 555ea8334451c5ccd881e68b8b7ddc15745e66e3.

The attached patch fixes the bug and includes a test to demonstrate the issue.


Files

ruby-irb.patch (1.26 KB) ruby-irb.patch Patch to fix IRB pjones (Peter Jones), 03/24/2022 08:10 PM

Updated by jeremyevans0 (Jeremy Evans) almost 2 years ago

Can you please submit this as a pull request upstream?: https://github.com/ruby/irb/pulls

Updated by hsbt (Hiroshi SHIBATA) over 1 year ago

  • Status changed from Open to Closed

This patch has been merged at https://github.com/ruby/irb/pull/353

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0