summaryrefslogtreecommitdiff
path: root/ext/readline
diff options
context:
space:
mode:
Diffstat (limited to 'ext/readline')
-rw-r--r--ext/readline/readline.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 25b8013177..abb9a0a33a 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -144,7 +144,6 @@ readline_event(void)
static VALUE
readline_get(VALUE prompt)
{
- rl_prep_terminal(1);
return (VALUE)readline((char *)prompt);
}
@@ -250,6 +249,9 @@ readline_readline(int argc, VALUE *argv, VALUE self)
if (!isatty(0) && errno == EBADF) rb_raise(rb_eIOError, "closed stdin");
+#ifdef _WIN32
+ rl_prep_terminal(1);
+#endif
buff = (char*)rb_protect(readline_get, (VALUE)prompt, &status);
if (status) {
#if defined HAVE_RL_CLEANUP_AFTER_SIGNAL