aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ext/pty/pty.c8
-rw-r--r--test/io/console/test_io_console.rb8
2 files changed, 16 insertions, 0 deletions
diff --git a/ext/pty/pty.c b/ext/pty/pty.c
index 29cc689380..9260194f35 100644
--- a/ext/pty/pty.c
+++ b/ext/pty/pty.c
@@ -503,6 +503,14 @@ pty_close_pty(VALUE assoc)
* +slave_file+:: the slave of the pty, as a File. The path to the
* terminal device is available via +slave_file.path+
*
+ * IO#raw! is usable to disable newline conversions:
+ *
+ * require 'io/console'
+ * PTY.open {|m, s|
+ * s.raw!
+ * ...
+ * }
+ *
*/
static VALUE
pty_open(VALUE klass)
diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb
index a44e5ffff9..c69eec757e 100644
--- a/test/io/console/test_io_console.rb
+++ b/test/io/console/test_io_console.rb
@@ -68,6 +68,14 @@ class TestIO_Console < Test::Unit::TestCase
}
end
+ def test_raw!
+ helper {|m, s|
+ s.raw!
+ s.print "foo\n"
+ assert_equal("foo\n", m.gets)
+ }
+ end
+
def test_cooked
helper {|m, s|
assert_send([s, :echo?])