diff options
-rw-r--r-- | sample/pty/shl.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sample/pty/shl.rb b/sample/pty/shl.rb index 1a878ac8aa..b5cc55fa83 100644 --- a/sample/pty/shl.rb +++ b/sample/pty/shl.rb @@ -11,6 +11,7 @@ # q quit require 'pty' +require 'io/console' $shells = [] $n_shells = 0 @@ -19,7 +20,7 @@ $r_pty = nil $w_pty = nil def writer - system "stty -echo raw" + STDIN.raw! begin while true c = STDIN.getc @@ -34,7 +35,7 @@ def writer $reader.raise('Exit') return 'Exit' ensure - system "stty echo -raw" + STDIN.cooked! end end |