diff --git a/NEWS b/NEWS index 195115821e06..88778699e090 100644 --- a/NEWS +++ b/NEWS @@ -45,6 +45,10 @@ PHP NEWS . Fixed segfault in ReflectionMethod::createFromMethodName() on an uninstantiable subclass. (iliaal) +- Readline: + . Fixed the interactive shell not waiting for the pager process to exit. + (Weilin Du) + - Sockets: . Fixed socket_set_option() validation error messages for UDP_SEGMENT and SO_LINGER options. (Weilin Du) diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c index ca4e8eb4fe9f..fb8f9a261637 100644 --- a/ext/readline/readline_cli.c +++ b/ext/readline/readline_cli.c @@ -712,7 +712,7 @@ static int readline_shell_run(void) /* {{{ */ } if (pager_pipe) { - fclose(pager_pipe); + pclose(pager_pipe); pager_pipe = NULL; } diff --git a/ext/readline/tests/readline_cli_pager.phpt b/ext/readline/tests/readline_cli_pager.phpt new file mode 100644 index 000000000000..2d5309472324 --- /dev/null +++ b/ext/readline/tests/readline_cli_pager.phpt @@ -0,0 +1,29 @@ +--TEST-- +Interactive shell: output through cli.pager +--EXTENSIONS-- +readline +--SKIPIF-- + +--FILE-- + +--EXPECT-- +Interactive shell + +php > echo "pager output +php " "; +pager output +PAGER OUTPUT +php > quit