diff options
author | Remi Collet <remi@php.net> | 2014-06-23 10:04:40 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2014-06-23 10:04:40 +0200 |
commit | 86bafec836b81070547399b890c5b01897250a31 (patch) | |
tree | 36d14adfe37aa9960410ba6df5a53b5832db86c9 /sapi/phpdbg/phpdbg_utils.c | |
parent | f08a5bfadc360cb53574bdb2f4dc32ac30636133 (diff) | |
download | php-git-86bafec836b81070547399b890c5b01897250a31.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.c | 6 |
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]); |