summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_utils.c
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2014-06-23 10:04:40 +0200
committerRemi Collet <remi@php.net>2014-06-23 10:21:19 +0200
commit0febafcfbe3e35f4a230430368ba931f19f8e957 (patch)
tree745cc1c42877f144a24f643dc80c9a5b940175c8 /sapi/phpdbg/phpdbg_utils.c
parent53158f2c32c71bddbfaa390c0c4758bc98540946 (diff)
downloadphp-git-0febafcfbe3e35f4a230430368ba931f19f8e957.tar.gz
Fix https://github.com/krakjoe/phpdbg/issues/91
Enable edit feature when build with libedit. Notice: coloured prompt only enable with READLINE
Diffstat (limited to 'sapi/phpdbg/phpdbg_utils.c')
-rw-r--r--sapi/phpdbg/phpdbg_utils.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c
index 98748b202a..3b4eac7327 100644
--- a/sapi/phpdbg/phpdbg_utils.c
+++ b/sapi/phpdbg/phpdbg_utils.c
@@ -400,12 +400,16 @@ PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D) /* {{{ */
}
/* create cached prompt */
+#ifdef HAVE_LIBREADLINE
+ /* TODO: libedit doesn't seems to support coloured prompt */
if ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED)) {
asprintf(
&PHPDBG_G(prompt)[1], "\033[%sm%s\033[0m ",
PHPDBG_G(colors)[PHPDBG_COLOR_PROMPT]->code,
PHPDBG_G(prompt)[0]);
- } else {
+ } else
+#endif
+ {
asprintf(
&PHPDBG_G(prompt)[1], "%s ",
PHPDBG_G(prompt)[0]);