mirror of
https://github.com/tmux/tmux.git
synced 2024-10-31 22:58:49 +00:00
Use VIS_CSTYLE for the arguments and add the missing escapes it can
generate to the parser.
This commit is contained in:
parent
c17edd594e
commit
7dced37673
@ -218,7 +218,7 @@ args_escape(const char *s)
|
|||||||
return (escaped);
|
return (escaped);
|
||||||
}
|
}
|
||||||
|
|
||||||
flags = VIS_OCTAL|VIS_TAB|VIS_NL;
|
flags = VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL;
|
||||||
if (s[strcspn(s, quoted)] != '\0')
|
if (s[strcspn(s, quoted)] != '\0')
|
||||||
flags |= VIS_DQ;
|
flags |= VIS_DQ;
|
||||||
utf8_stravis(&escaped, s, flags);
|
utf8_stravis(&escaped, s, flags);
|
||||||
|
15
cmd-parse.y
15
cmd-parse.y
@ -1118,9 +1118,24 @@ yylex_token_escape(char **buf, size_t *len)
|
|||||||
switch (ch) {
|
switch (ch) {
|
||||||
case EOF:
|
case EOF:
|
||||||
return (0);
|
return (0);
|
||||||
|
case 'a':
|
||||||
|
ch = '\a';
|
||||||
|
break;
|
||||||
|
case 'b':
|
||||||
|
ch = '\b';
|
||||||
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
ch = '\033';
|
ch = '\033';
|
||||||
break;
|
break;
|
||||||
|
case 'f':
|
||||||
|
ch = '\f';
|
||||||
|
break;
|
||||||
|
case 's':
|
||||||
|
ch = ' ';
|
||||||
|
break;
|
||||||
|
case 'v':
|
||||||
|
ch = '\v';
|
||||||
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
ch = '\r';
|
ch = '\r';
|
||||||
break;
|
break;
|
||||||
|
@ -685,7 +685,7 @@ tty_term_describe(struct tty_term *term, enum tty_code_code code)
|
|||||||
break;
|
break;
|
||||||
case TTYCODE_STRING:
|
case TTYCODE_STRING:
|
||||||
strnvis(out, term->codes[code].value.string, sizeof out,
|
strnvis(out, term->codes[code].value.string, sizeof out,
|
||||||
VIS_OCTAL|VIS_TAB|VIS_NL);
|
VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL);
|
||||||
xsnprintf(s, sizeof s, "%4u: %s: (string) %s",
|
xsnprintf(s, sizeof s, "%4u: %s: (string) %s",
|
||||||
code, tty_term_codes[code].name,
|
code, tty_term_codes[code].name,
|
||||||
out);
|
out);
|
||||||
|
@ -246,7 +246,7 @@ window_buffer_draw(__unused void *modedata, void *itemdata,
|
|||||||
at = 0;
|
at = 0;
|
||||||
while (end != pdata + psize && *end != '\n') {
|
while (end != pdata + psize && *end != '\n') {
|
||||||
if ((sizeof line) - at > 5) {
|
if ((sizeof line) - at > 5) {
|
||||||
cp = vis(line + at, *end, VIS_TAB|VIS_OCTAL, 0);
|
cp = vis(line + at, *end, VIS_OCTAL|VIS_TAB, 0);
|
||||||
at = cp - line;
|
at = cp - line;
|
||||||
}
|
}
|
||||||
end++;
|
end++;
|
||||||
|
Loading…
Reference in New Issue
Block a user