]> granicus.if.org Git - php/commitdiff
Always show the prompt (now also: <prompt> tag)
authorBob Weinand <bobwei9@hotmail.com>
Mon, 20 Oct 2014 20:05:05 +0000 (22:05 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Mon, 20 Oct 2014 20:05:05 +0000 (22:05 +0200)
phpdbg_cmd.c
xml.md

index c09df70a41422dfb23efddb7e5049e80864d2af0..30ea48cfbe47420daa55b21bbf5d97aef94d2e0a 100644 (file)
@@ -813,14 +813,6 @@ disconnect:
                        }
 
 #define USE_LIB_STAR (defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT))
-#if !USE_LIB_STAR
-                       if (!(PHPDBG_G(flags) & PHPDBG_IS_REMOTE)) {
-                               if (!phpdbg_out("%s", phpdbg_get_prompt(TSRMLS_C))) {
-                                       goto disconnect;
-                               }
-                               PHPDBG_G(last_was_newline) = 1;
-                       }
-#endif
 
                        /* note: EOF makes readline write prompt again in local console mode - and ignored if compiled without readline */
                        /* strongly assuming to be in blocking mode... */
@@ -835,6 +827,9 @@ readline:
                                        memcpy(buf, PHPDBG_G(input_buffer), bytes);
                                }
 
+                               phpdbg_write("prompt", "", "%s", phpdbg_get_prompt(TSRMLS_C));
+                               PHPDBG_G(last_was_newline) = 1;
+
                                do {
                                        int i;
                                        if (bytes <= 0) { 
@@ -864,7 +859,7 @@ readline:
                                        }
                                        len += bytes;
                                        /* XXX export the timeout through INI??*/
-                               } while ((bytes = phpdbg_mixed_read(PHPDBG_G(io)[PHPDBG_STDIN].fd, buf + len, PHPDBG_MAX_CMD - len, -1 TSRMLS_CC)) > 0 || (errno == EINTR && bytes < 0));
+                               } while ((bytes = phpdbg_mixed_read(PHPDBG_G(io)[PHPDBG_STDIN].fd, buf + len, PHPDBG_MAX_CMD - len, -1 TSRMLS_CC)) > 0);
 
                                if (bytes <= 0) {
                                        goto disconnect;
diff --git a/xml.md b/xml.md
index 1cb164629a713e4ddf76cac655aa987db7811c36..05734d6be8951eff9efb3f0e7d8a640d89ba807b 100644 (file)
--- a/xml.md
+++ b/xml.md
@@ -77,6 +77,11 @@ intro
 - help: command name for help
 - report: URL for bug reporting
 
+prompt
+------
+
+- msg tag contains the text prompt
+- indicates that a new command may be accepted
 
 phpdbg
 ------