Ticket #3241: colon was not recognized inside escape seq in prompt.

export PS1=$'\[\e[38:5:214m\]orange$\[\e[0m\]'
mc

Expected: "orange$" prompt shows up in black under the panels.
Actual: some additional garbage.

The 256-color and true-color escape sequences should allow either ';' or
':' inside as separator, actually, ':' is the more correct according to
ECMA-48. Some terminal emulators (e.g. xterm, gnome-terminal) support
this.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Egmont Koblinger 2014-09-03 11:31:14 +04:00 committed by Andrew Borodin
parent d6004701cc
commit a3d75ae300
1 changed files with 6 additions and 6 deletions

View File

@ -718,12 +718,12 @@ skip_numbers (const char *s)
* "control sequence", in a sort of pidgin BNF, as follows:
*
* control-seq = Esc non-'['
* | Esc '[' (0 or more digits or ';' or '?') (any other char)
* | Esc '[' (0 or more digits or ';' or ':' or '?') (any other char)
*
* The 256-color and true-color escape sequences should allow either ';' or ':' inside as separator,
* actually, ':' is the more correct according to ECMA-48.
* Some terminal emulators (e.g. xterm, gnome-terminal) support this.
*
* This scheme works for all the terminals described in my termcap /
* terminfo databases, except the Hewlett-Packard 70092 and some Wyse
* terminals. If I hear from a single person who uses such a terminal
* with MC, I'll be glad to add support for it. (Dugan)
* Non-printable characters are also removed.
*/
@ -745,7 +745,7 @@ strip_ctrl_codes (char *s)
if (*(++r) == '[' || *r == '(')
{
/* strchr() matches trailing binary 0 */
while (*(++r) != '\0' && strchr ("0123456789;?", *r) != NULL)
while (*(++r) != '\0' && strchr ("0123456789;:?", *r) != NULL)
;
}
else if (*r == ']')