diff options
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | arguments.c | 2 | ||||
-rw-r--r-- | cmd-parse.y | 41 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | regress/command-order.sh | 6 | ||||
-rw-r--r-- | regress/xenl-terminal.sh | 29 | ||||
-rw-r--r-- | tmux.1 | 8 | ||||
-rw-r--r-- | tty-term.c | 2 | ||||
-rw-r--r-- | tty.c | 11 | ||||
-rw-r--r-- | window-buffer.c | 2 |
10 files changed, 95 insertions, 12 deletions
@@ -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 113e6a92..d5d12d95 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/regress/command-order.sh b/regress/command-order.sh index fb4e0324..04046f0d 100644 --- a/regress/command-order.sh +++ b/regress/command-order.sh @@ -1,7 +1,5 @@ #!/bin/sh -# new-session without clients should be the right size - PATH=/bin:/usr/bin TERM=screen @@ -19,6 +17,7 @@ EOF $TMUX -f$TMP start </dev/null || exit 1 sleep 1 $TMUX lsw -aF '#{session_name},#{window_name}'|sort >$TMP || exit 1 +$TMUX kill-server 2>/dev/null cat <<EOF|cmp -s $TMP - || exit 1 bar,bar0 bar,bar1 @@ -27,7 +26,6 @@ foo,foo0 foo,foo1 foo,foo2 EOF -$TMUX kill-server 2>/dev/null cat <<EOF >$TMP new -sfoo -nfoo0 @@ -40,6 +38,7 @@ EOF $TMUX -f$TMP start </dev/null || exit 1 sleep 1 $TMUX lsw -aF '#{session_name},#{window_name}'|sort >$TMP || exit 1 +$TMUX kill-server 2>/dev/null cat <<EOF|cmp -s $TMP - || exit 1 bar,bar0 bar,bar1 @@ -48,6 +47,5 @@ foo,foo0 foo,foo1 foo,foo2 EOF -$TMUX kill-server 2>/dev/null exit 0 diff --git a/regress/xenl-terminal.sh b/regress/xenl-terminal.sh new file mode 100644 index 00000000..07469ceb --- /dev/null +++ b/regress/xenl-terminal.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +PATH=/bin:/usr/bin +TERM=screen + +[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux) +TMUX="$TEST_TMUX -Ltest" +$TMUX kill-server 2>/dev/null +TMUX2="$TEST_TMUX -Ltest2" +$TMUX2 kill-server 2>/dev/null + +TMP=$(mktemp) +trap "rm -f $TMP" 0 1 15 + +$TMUX2 -f/dev/null new -d || exit 1 +$TMUX2 set -as terminal-overrides ',*:xenl@' || exit 1 +$TMUX2 set -g status-right 'RRR' || exit 1 +$TMUX2 set -g status-left 'LLL' || exit 1 +$TMUX2 set -g window-status-current-format 'WWW' || exit 1 +$TMUX -f/dev/null new -x20 -y2 -d "$TMUX2 attach" || exit 1 +sleep 1 +$TMUX capturep -p|tail -1 >$TMP || exit 1 +$TMUX kill-server 2>/dev/null +$TMUX2 kill-server 2>/dev/null +cat <<EOF|cmp -s $TMP - || exit 1 +LLLWWW RR +EOF + +exit 0 @@ -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 @@ -4328,7 +4332,7 @@ Align text to the left, centre or right of the available space if appropriate. .It Xo Ic list=on , .Ic list=focus , .Ic list=left-marker , -.Ic list=right=marker , +.Ic list=right-marker , .Ic nolist .Xc Mark the position of the various window list components in the @@ -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); @@ -527,6 +527,12 @@ tty_putc(struct tty *tty, u_char ch) { const char *acs; + if ((tty->term->flags & TERM_EARLYWRAP) && + ch >= 0x20 && ch != 0x7f && + tty->cy == tty->sy - 1 && + tty->cx + 1 >= tty->sx) + return; + if (tty->cell.attr & GRID_ATTR_CHARSET) { acs = tty_acs_get(tty, ch); if (acs != NULL) @@ -557,6 +563,11 @@ tty_putc(struct tty *tty, u_char ch) void tty_putn(struct tty *tty, const void *buf, size_t len, u_int width) { + if ((tty->term->flags & TERM_EARLYWRAP) && + tty->cy == tty->sy - 1 && + tty->cx + len >= tty->sx) + len = tty->sx - tty->cx - 1; + tty_add(tty, buf, len); if (tty->cx + width > tty->sx) { tty->cx = (tty->cx + width) - tty->sx; 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++; |