]> granicus.if.org Git - php/commitdiff
Fix Bug #65714 PHP cli forces the tty to cooked mode
authorRemi Collet <remi@php.net>
Fri, 15 Nov 2013 08:49:42 +0000 (09:49 +0100)
committerRemi Collet <remi@php.net>
Fri, 15 Nov 2013 08:49:42 +0000 (09:49 +0100)
Only drop the using_history() call with libedit as I don't know
if it is required with readline.

This also allow to run a php script in background without
it being aborted on first output.

ext/readline/readline.c

index bd460696bd7048648d4b73b15745ee536812b176..d4032ca94718a291e1f69c16d9da6bd1fffd806a 100644 (file)
@@ -170,7 +170,10 @@ ZEND_GET_MODULE(readline)
 
 PHP_MINIT_FUNCTION(readline)
 {
-       using_history();
+#if HAVE_LIBREADLINE
+               /* libedit don't need this call which set the tty in cooked mode */
+               using_history();
+#endif
        return PHP_MINIT(cli_readline)(INIT_FUNC_ARGS_PASSTHRU);
 }