aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES4
-rw-r--r--arguments.c2
-rw-r--r--cmd-parse.y41
-rw-r--r--configure.ac2
-rw-r--r--tmux.16
-rw-r--r--tty-term.c2
-rw-r--r--window-buffer.c2
7 files changed, 52 insertions, 7 deletions
diff --git a/CHANGES b/CHANGES
index 3faf716f..edd4751b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+CHANGES FROM 3.0 to X.X
+
+XXX
+
CHANGES FROM 2.9 to 3.0
* INCOMPATIBLE: Add a new {} syntax to the configuration file. This is a string
diff --git a/arguments.c b/arguments.c
index 38e50829..c8a6ab45 100644
--- a/arguments.c
+++ b/arguments.c
@@ -217,7 +217,7 @@ args_escape(const char *s)
return (escaped);
}
- flags = VIS_OCTAL|VIS_TAB|VIS_NL;
+ flags = VIS_OCTAL|VIS_CSTYLE|VIS_TAB|VIS_NL;
if (s[strcspn(s, quoted)] != '\0')
flags |= VIS_DQ;
utf8_stravis(&escaped, s, flags);
diff --git a/cmd-parse.y b/cmd-parse.y
index d984b9d3..a623caa5 100644
--- a/cmd-parse.y
+++ b/cmd-parse.y
@@ -1088,17 +1088,54 @@ error:
static int
yylex_token_escape(char **buf, size_t *len)
{
- int ch, type;
+ int ch, type, o2, o3;
u_int size, i, tmp;
char s[9];
struct utf8_data ud;
- switch (ch = yylex_getc()) {
+ ch = yylex_getc();
+
+ if (ch >= '4' && ch <= '7') {
+ yyerror("invalid octal escape");
+ return (0);
+ }
+ if (ch >= '0' && ch <= '3') {
+ o2 = yylex_getc();
+ if (o2 >= '0' && o2 <= '7') {
+ o3 = yylex_getc();
+ if (o3 >= '0' && o3 <= '7') {
+ ch = 64 * (ch - '0') +
+ 8 * (o2 - '0') +
+ (o3 - '0');
+ yylex_append1(buf, len, ch);
+ return (1);
+ }
+ }
+ yyerror("invalid octal escape");
+ return (0);
+ }
+
+ switch (ch) {
case EOF:
return (0);
+ case 'a':
+ ch = '\a';
+ break;
+ case 'b':
+ ch = '\b';
+ break;
case 'e':
ch = '\033';
break;
+ case 'f':
+ ch = '\f';
+ break;
+ case 's':
+ ch = ' ';
+ break;
+ case 'v':
+ ch = '\v';
+ break;
case 'r':
ch = '\r';
break;
diff --git a/configure.ac b/configure.ac
index 2c1a8945..5fba1eaf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
# configure.ac
-AC_INIT([tmux], 3.0-rc)
+AC_INIT([tmux], next-3.1)
AC_PREREQ([2.60])
AC_CONFIG_AUX_DIR(etc)
diff --git a/tmux.1 b/tmux.1
index 263aecbc..954a6493 100644
--- a/tmux.1
+++ b/tmux.1
@@ -520,7 +520,11 @@ the given four or eight digit hexadecimal number.
When preceded (escaped) by a \e, the following characters are replaced: \ee by
the escape character; \er by a carriage return; \en by a newline; and \et by a
tab.
-.Pp
+.It
+\eooo is replaced by a character of the octal value ooo.
+Three octal digits are required, for example \e001.
+The largest valid character is \e377.
+.It
Any other characters preceded by \e are replaced by themselves (that is, the \e
is removed) and are not treated as having any special meaning - so for example
\e; will not mark a command sequence and \e$ will not expand an environment
diff --git a/tty-term.c b/tty-term.c
index b3fc8e0d..d2cdf86a 100644
--- a/tty-term.c
+++ b/tty-term.c
@@ -691,7 +691,7 @@ tty_term_describe(struct tty_term *term, enum tty_code_code code)
break;
case TTYCODE_STRING:
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",
code, tty_term_codes[code].name,
out);
diff --git a/window-buffer.c b/window-buffer.c
index d65916b5..224dfedb 100644
--- a/window-buffer.c
+++ b/window-buffer.c
@@ -245,7 +245,7 @@ window_buffer_draw(__unused void *modedata, void *itemdata,
at = 0;
while (end != pdata + psize && *end != '\n') {
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;
}
end++;