From a3d75ae300c9a3150125324ae64db0b19506dadf Mon Sep 17 00:00:00 2001 From: Egmont Koblinger Date: Wed, 3 Sep 2014 11:31:14 +0400 Subject: [PATCH] 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 --- lib/util.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/util.c b/lib/util.c index a592b822f..ceace41f1 100644 --- a/lib/util.c +++ b/lib/util.c @@ -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 == ']') -- 2.11.4.GIT