[前][次][番号順一覧][スレッド一覧]

ruby-changes:58834

From: Nobuyoshi <ko1@a...>
Date: Tue, 19 Nov 2019 04:39:06 +0900 (JST)
Subject: [ruby-changes:58834] cef9ebfbd3 (master): Suppress `stty` error on Apple Terminal

https://git.ruby-lang.org/ruby.git/commit/?id=cef9ebfbd3

From cef9ebfbd3565f9feb25d0140da3176ea26bf4a9 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 13 Nov 2019 15:28:12 +0900
Subject: Suppress `stty` error on Apple Terminal

`stty` called in `Reline::ANSI.deprep` command shows the following
error message on macOS Apple Terminal, with some settings.

```
$ LANG=C irb
irb(main):001:0>
stty: 'standard input': unable to perform all requested operations
stty: 'standard input': unable to perform all requested operations
```

diff --git a/lib/reline/ansi.rb b/lib/reline/ansi.rb
index 35497ab..9b83a00 100644
--- a/lib/reline/ansi.rb
+++ b/lib/reline/ansi.rb
@@ -135,7 +135,7 @@ class Reline::ANSI https://github.com/ruby/ruby/blob/trunk/lib/reline/ansi.rb#L135
 
   def self.deprep(otio)
     int_handle = Signal.trap('INT', 'IGNORE')
-    `stty #{otio}`
+    system("stty #{otio}", err: File::NULL)
     Signal.trap('INT', int_handle)
     Signal.trap('WINCH', @@old_winch_handler) if @@old_winch_handler
   end
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]