Exempt paging from -qrr mode

This commit is contained in:
Bob Weinand 2015-10-20 21:56:00 +02:00
parent 1149833a58
commit 2ef327caed
2 changed files with 10 additions and 9 deletions

View file

@ -1845,7 +1845,7 @@ phpdbg_interact:
quit_immediately = phpdbg_startup_run > 1;
phpdbg_startup_run = 0;
if (quit_immediately) {
PHPDBG_G(flags) |= PHPDBG_IS_INTERACTIVE | PHPDBG_PREVENT_INTERACTIVE;
PHPDBG_G(flags) = (PHPDBG_G(flags) & ~PHPDBG_HAS_PAGINATION) | PHPDBG_IS_INTERACTIVE | PHPDBG_PREVENT_INTERACTIVE;
} else {
PHPDBG_G(flags) |= PHPDBG_IS_INTERACTIVE;
}

View file

@ -202,13 +202,13 @@ static int phpdbg_output_pager(int sock, const char *ptr, int len) {
bytes += write(sock, ptr + bytes, (p - ptr) - bytes);
if (memchr(p, '\n', endp - p)) {
int chr;
printf("\r---Type <return> to continue or q <return> to quit---");
chr = getchar();
if (chr == 'q') {
char buf[PHPDBG_MAX_CMD];
write(sock, ZEND_STRL("\r---Type <return> to continue or q <return> to quit---"));
phpdbg_consume_stdin_line(buf);
if (*buf == 'q') {
break;
}
printf("\r");
write(sock, "\r", 1);
} else break;
}
}
@ -225,9 +225,10 @@ PHPDBG_API int phpdbg_mixed_write(int sock, const char *ptr, int len) {
return phpdbg_send_bytes(sock, ptr, len);
}
if (PHPDBG_G(flags) & PHPDBG_HAS_PAGINATION
&& PHPDBG_G(io)[PHPDBG_STDOUT].fd == sock
&& PHPDBG_G(lines) > 0) {
if ((PHPDBG_G(flags) & PHPDBG_HAS_PAGINATION)
&& !(PHPDBG_G(flags) & PHPDBG_WRITE_XML)
&& PHPDBG_G(io)[PHPDBG_STDOUT].fd == sock
&& PHPDBG_G(lines) > 0) {
return phpdbg_output_pager(sock, ptr, len);
}