mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
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:
parent
d6004701cc
commit
a3d75ae300
12
lib/util.c
12
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 == ']')
|
||||
|
Loading…
Reference in New Issue
Block a user