@@ -111,6 +111,9 @@ rawmode_opt(int *argcp, VALUE *argv, int min_argc, int max_argc, rawmode_arg_t *
111111 int argc = * argcp ;
112112 rawmode_arg_t * optp = NULL ;
113113 VALUE vopts = Qnil ;
114+ #ifdef RB_SCAN_ARGS_PASS_CALLED_KEYWORDS
115+ argc = rb_scan_args (argc , argv , "*:" , NULL , & vopts );
116+ #else
114117 if (argc > min_argc ) {
115118 vopts = rb_check_hash_type (argv [argc - 1 ]);
116119 if (!NIL_P (vopts )) {
@@ -120,6 +123,7 @@ rawmode_opt(int *argcp, VALUE *argv, int min_argc, int max_argc, rawmode_arg_t *
120123 if (!vopts ) vopts = Qnil ;
121124 }
122125 }
126+ #endif
123127 rb_check_arity (argc , min_argc , max_argc );
124128 if (!NIL_P (vopts )) {
125129 VALUE vmin = rb_hash_aref (vopts , ID2SYM (id_min ));
@@ -188,8 +192,9 @@ set_rawmode(conmode *t, void *arg)
188192#endif
189193#ifdef ISIG
190194 if (r -> intr ) {
191- t -> c_iflag |= BRKINT | IXON ;
195+ t -> c_iflag |= BRKINT ;
192196 t -> c_lflag |= ISIG ;
197+ t -> c_oflag |= OPOST ;
193198 }
194199#endif
195200 (void )r ;
@@ -355,9 +360,9 @@ ttymode_with_io(VALUE io, VALUE (*func)(VALUE, VALUE), VALUE farg, void (*setter
355360
356361/*
357362 * call-seq:
358- * io.raw(min: nil, time: nil) {|io| }
363+ * io.raw(min: nil, time: nil, intr: nil ) {|io| }
359364 *
360- * Yields +self+ within raw mode.
365+ * Yields +self+ within raw mode, and returns the result of the block .
361366 *
362367 * STDIN.raw(&:gets)
363368 *
@@ -369,6 +374,9 @@ ttymode_with_io(VALUE io, VALUE (*func)(VALUE, VALUE), VALUE farg, void (*setter
369374 * The parameter +time+ specifies the timeout in _seconds_ with a
370375 * precision of 1/10 of a second. (default: 0)
371376 *
377+ * If the parameter +intr+ is +true+, enables break, interrupt, quit,
378+ * and suspend special characters.
379+ *
372380 * Refer to the manual page of termios for further details.
373381 *
374382 * You must require 'io/console' to use this method.
@@ -382,11 +390,11 @@ console_raw(int argc, VALUE *argv, VALUE io)
382390
383391/*
384392 * call-seq:
385- * io.raw!(min: nil, time: nil)
393+ * io.raw!(min: nil, time: nil, intr: nil) -> io
386394 *
387- * Enables raw mode.
395+ * Enables raw mode, and returns +io+ .
388396 *
389- * If the terminal mode needs to be back, use io.raw { ... }.
397+ * If the terminal mode needs to be back, use <code> io.raw { ... }</code> .
390398 *
391399 * See IO#raw for details on the parameters.
392400 *
@@ -482,7 +490,7 @@ nogvl_getch(void *p)
482490
483491/*
484492 * call-seq:
485- * io.getch(min: nil, time: nil) -> char
493+ * io.getch(min: nil, time: nil, intr: nil) -> char
486494 *
487495 * Reads and returns a character in raw mode.
488496 *
@@ -1489,7 +1497,7 @@ console_dev(int argc, VALUE *argv, VALUE klass)
14891497
14901498/*
14911499 * call-seq:
1492- * io.getch(min: nil, time: nil) -> char
1500+ * io.getch(min: nil, time: nil, intr: nil) -> char
14931501 *
14941502 * See IO#getch.
14951503 */
0 commit comments