aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-07-21 15:53:59 -0600
committerJosh Rahm <rahm@google.com>2022-07-21 15:53:59 -0600
commitb11548e3db4361cd8312ffbd27472823bdab4d62 (patch)
treea84b5cf79fb41bb60b6495c1a346bb360b224604
parent88ebf5544e995d85b2f1416a216ac7f44f719eed (diff)
parentab1d18d00febe161080b8e81331861481110809f (diff)
downloadrtmux-b11548e3db4361cd8312ffbd27472823bdab4d62.tar.gz
rtmux-b11548e3db4361cd8312ffbd27472823bdab4d62.tar.bz2
rtmux-b11548e3db4361cd8312ffbd27472823bdab4d62.zip
Merge remote-tracking branch 'origin/master' into rahm
-rw-r--r--.github/CONTRIBUTING.md2
-rw-r--r--.github/README.md2
-rw-r--r--.github/workflows/lock.yml6
-rw-r--r--CHANGES101
-rw-r--r--Makefile.am8
-rw-r--r--README2
-rw-r--r--README.ja2
-rw-r--r--arguments.c126
-rw-r--r--cfg.c26
-rw-r--r--client.c3
-rw-r--r--cmd-attach-session.c6
-rw-r--r--cmd-capture-pane.c14
-rw-r--r--cmd-choose-tree.c2
-rw-r--r--cmd-command-prompt.c2
-rw-r--r--cmd-confirm-before.c2
-rw-r--r--cmd-display-menu.c58
-rw-r--r--cmd-display-panes.c6
-rw-r--r--cmd-if-shell.c2
-rw-r--r--cmd-join-pane.c36
-rw-r--r--cmd-list-clients.c2
-rw-r--r--cmd-load-buffer.c2
-rw-r--r--cmd-new-session.c10
-rw-r--r--cmd-pipe-pane.c8
-rw-r--r--cmd-queue.c30
-rw-r--r--cmd-refresh-client.c39
-rw-r--r--cmd-resize-pane.c13
-rw-r--r--cmd-run-shell.c22
-rw-r--r--cmd-select-layout.c7
-rw-r--r--cmd-send-keys.c5
-rw-r--r--cmd-server-access.c147
-rw-r--r--cmd-set-buffer.c16
-rw-r--r--cmd-show-options.c11
-rw-r--r--cmd-split-window.c70
-rw-r--r--cmd-swap-pane.c3
-rw-r--r--cmd.c2
-rw-r--r--colour.c17
-rw-r--r--compat.h10
-rw-r--r--compat/getpeereid.c54
-rw-r--r--compat/systemd.c58
-rw-r--r--configure.ac43
-rw-r--r--control.c8
-rw-r--r--format-draw.c13
-rw-r--r--format.c224
-rw-r--r--grid-view.c2
-rw-r--r--grid.c185
-rw-r--r--hyperlinks.c227
-rw-r--r--input-keys.c46
-rw-r--r--input.c192
-rw-r--r--job.c6
-rw-r--r--key-bindings.c5
-rw-r--r--key-string.c42
-rw-r--r--layout-custom.c23
-rw-r--r--log.c2
-rw-r--r--menu.c66
-rw-r--r--mode-tree.c30
-rw-r--r--notify.c63
-rw-r--r--options-table.c119
-rw-r--r--options.c49
-rw-r--r--osdep-netbsd.c3
-rw-r--r--osdep-openbsd.c4
-rw-r--r--paste.c8
-rw-r--r--popup.c157
-rw-r--r--proc.c19
-rw-r--r--regress/capture-pane-hyperlink.sh30
-rw-r--r--regress/capture-pane-sgr0.sh4
-rw-r--r--regress/if-shell-error.sh13
-rw-r--r--regress/kill-session-process-exit.sh3
-rw-r--r--resize.c5
-rw-r--r--screen-redraw.c183
-rw-r--r--screen-write.c113
-rw-r--r--screen.c63
-rw-r--r--server-acl.c186
-rw-r--r--server-client.c765
-rw-r--r--server-fn.c42
-rw-r--r--server.c33
-rw-r--r--session.c5
-rw-r--r--spawn.c25
-rw-r--r--status.c74
-rw-r--r--style.c2
-rw-r--r--tmux.1418
-rw-r--r--tmux.c2
-rw-r--r--tmux.h491
-rw-r--r--tools/ansicode.txt10
-rw-r--r--tty-acs.c76
-rw-r--r--tty-features.c116
-rw-r--r--tty-keys.c157
-rw-r--r--tty-term.c2
-rw-r--r--tty.c454
-rw-r--r--utf8.c15
-rw-r--r--window-buffer.c4
-rw-r--r--window-client.c2
-rw-r--r--window-copy.c125
-rw-r--r--window-customize.c8
-rw-r--r--window-tree.c23
-rw-r--r--window.c37
95 files changed, 4789 insertions, 1165 deletions
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 89c6549b..0c517a52 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -29,7 +29,7 @@ uname -sp && tmux -V && echo $TERM
Also include:
-- Your platform (Linux, OS X, or whatever).
+- Your platform (Linux, macOS, or whatever).
- A brief description of the problem with steps to reproduce.
diff --git a/.github/README.md b/.github/README.md
index 5590d0b2..353f10ec 100644
--- a/.github/README.md
+++ b/.github/README.md
@@ -4,7 +4,7 @@ tmux is a terminal multiplexer: it enables a number of terminals to be created,
accessed, and controlled from a single screen. tmux may be detached from a
screen and continue running in the background, then later reattached.
-This release runs on OpenBSD, FreeBSD, NetBSD, Linux, OS X and Solaris.
+This release runs on OpenBSD, FreeBSD, NetBSD, Linux, macOS and Solaris.
## Dependencies
diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml
index c6691e46..a4d3e9b5 100644
--- a/.github/workflows/lock.yml
+++ b/.github/workflows/lock.yml
@@ -4,8 +4,14 @@ on:
schedule:
- cron: '0 0 * * *'
+permissions:
+ contents: read
+
jobs:
lock:
+ permissions:
+ issues: write # for dessant/lock-threads to lock issues
+ pull-requests: write # for dessant/lock-threads to lock PRs
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2
diff --git a/CHANGES b/CHANGES
index d1dbb6ea..e5942216 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,102 @@
+CHANGES FROM 3.3 TO 3.3a
+
+* Do not crash when run-shell produces output from a config file.
+
+* Do not unintentionally turn off all mouse mode when button mode is also
+ present.
+
CHANGES FROM 3.2a TO 3.3
+* Add an ACL list for users connecting to the tmux socket. Users may be
+ forbidden from attaching, forced to attach read-only, or allowed to attach
+ read-write. A new command, server-access, configures the list. File system
+ permissions must still be configured manually.
+
+* Emit window-layout-changed on swap-pane.
+
+* Better error reporting when applying custom layouts.
+
+* Handle ANSI escape sequences in run-shell output.
+
+* Add pane_start_path to match start_command.
+
+* Set PWD so shells have a hint about the real path.
+
+* Do not allow pipe-pane on dead panes.
+
+* Do not report mouse positions (incorrectly) above the maximum of 223 in
+ normal mouse mode.
+
+* Add an option (default off) to control the passthrough escape sequence.
+
+* Support more mouse buttons when the terminal sends them.
+
+* Add a window-resized hook which is fired when the window is actually resized
+ which may be later than the client resize.
+
+* Add next_session_id format with the next session ID.
+
+* Add formats for client and server UID and user.
+
+* Add argument to refresh-client -l to forward clipboard to a pane.
+
+* Add remain-on-exit-format to set text shown when pane is dead.
+
+* With split-window -f use percentages of window size not pane size.
+
+* Add an option (fill-character) to set the character used for unused areas of
+ a client.
+
+* Add an option (scroll-on-clear) to control if tmux scrolls into history on
+ clear.
+
+* Add a capability for OSC 7 and use it similarly to how the title is set (and
+ controlled by the same set-titles option).
+
+* Add support for systemd socket activation (where systemd creates the Unix
+ domain socket for tmux rather than tmux creating it). Build with
+ --enable-systemd.
+
+* Add an option (pane-border-indicators) to select how the active pane is shown
+ on the pane border (colour, arrows or both).
+
+* Support underscore styles with capture-pane -e.
+
+* Make pane-border-format a pane option rather than window.
+
+* Respond to OSC 4 queries
+
+* Fix g/G keys in modes to do the same thing as copy mode (and vi).
+
+* Bump the time terminals have to respond to device attributes queries to three
+ seconds.
+
+* If automatic-rename is off, allow the rename escape sequence to set an empty
+ name.
+
+* Trim menu item text more intelligently.
+
+* Add cursor-style and cursor-colour options to set the default cursor style
+ and colour.
+
+* Accept some useful and non-conflicting emacs keys in vi normal mode at the
+ command prompt.
+
+* Add a format modifier (c) to force a colour to RGB.
+
+* Add -s and -S to display-popup to set styles, -b to set lines and -T to set
+ popup title. New popup-border-lines, popup-border-style and popup-style
+ options set the defaults.
+
+* Add -e flag to set an environment variable for a popup.
+
+* Make send-keys without arguments send the key it is bound to (if bound to a
+ key).
+
+* Try to leave terminal cursor at the right position even when tmux is drawing
+ its own cursor or selection (such as at the command prompt and in choose
+ mode) for people using screen readers and similar which can make use of it.
+
* Change so that {} is converted to tmux commands immediately when parsed. This
means it must contain valid tmux commands. For commands which expand %% and
%%%, this now only happens within string arguments. Use of nested aliases
@@ -1205,7 +1302,7 @@ Incompatible Changes
bind -Tcopy-mode C-r command-prompt -i -p'search up' "send -X search-backward-incremental '%%'"
- There are also some new commmands available with send -X, such as
+ There are also some new commands available with send -X, such as
copy-pipe-and-cancel.
* set-remain-on-exit has gone -- can be achieved with hooks instead.
* Hooks: before hooks have been removed and only a selection of commands now
@@ -3181,7 +3278,7 @@ The list of older changes is below.
* (nicm) -n on new-session is now -s, and -n is now the initial window name.
This was documented but not implemented :-/.
* (nicm) kill-window command, bound to & by default (because it should be hard
- to hit accidently).
+ to hit accidentally).
* (nicm) bell-style option with three choices: "none" completely ignore bell;
"any" pass through a bell in any window to current; "current" ignore bells
except in current window. This applies only to the bell terminal signal,
diff --git a/Makefile.am b/Makefile.am
index 68494932..14d8874b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -123,6 +123,7 @@ dist_tmux_SOURCES = \
cmd-select-pane.c \
cmd-select-window.c \
cmd-send-keys.c \
+ cmd-server-access.c \
cmd-set-buffer.c \
cmd-set-environment.c \
cmd-set-option.c \
@@ -149,6 +150,7 @@ dist_tmux_SOURCES = \
grid-reader.c \
grid-view.c \
grid.c \
+ hyperlinks.c \
input-keys.c \
input.c \
job.c \
@@ -172,6 +174,7 @@ dist_tmux_SOURCES = \
screen-redraw.c \
screen-write.c \
screen.c \
+ server-acl.c \
server-client.c \
server-fn.c \
server.c \
@@ -204,6 +207,11 @@ if NEED_FORKPTY
nodist_tmux_SOURCES += compat/forkpty-@PLATFORM@.c
endif
+# Add compat file for systemd.
+if HAVE_SYSTEMD
+nodist_tmux_SOURCES += compat/systemd.c
+endif
+
# Add compat file for utf8proc.
if HAVE_UTF8PROC
nodist_tmux_SOURCES += compat/utf8proc.c
diff --git a/README b/README
index 8732a027..57329629 100644
--- a/README
+++ b/README
@@ -4,7 +4,7 @@ tmux is a terminal multiplexer: it enables a number of terminals to be created,
accessed, and controlled from a single screen. tmux may be detached from a
screen and continue running in the background, then later reattached.
-This release runs on OpenBSD, FreeBSD, NetBSD, Linux, OS X and Solaris.
+This release runs on OpenBSD, FreeBSD, NetBSD, Linux, macOS and Solaris.
* Dependencies
diff --git a/README.ja b/README.ja
index 1580df52..3c944738 100644
--- a/README.ja
+++ b/README.ja
@@ -3,7 +3,7 @@ tmuxへようこそ!
tmuxはターミナルマルチプレクサーです。複数のターミナルを一つのスクリーン内に作成し、操作することができます。
バックグラウンドで処理を実行中に一度スクリーンから離れて後から復帰することも可能です。
-OpenBSD、FreeBSD、NetBSD、Linux、OS X、Solarisで実行できます。
+OpenBSD、FreeBSD、NetBSD、Linux、macOS、Solarisで実行できます。
tmuxはlibevent 2.x.に依存します。 下記からダウンロードしてください。
diff --git a/arguments.c b/arguments.c
index 4b08de2c..46777f7f 100644
--- a/arguments.c
+++ b/arguments.c
@@ -108,6 +108,7 @@ args_value_as_string(struct args_value *value)
case ARGS_STRING:
return (value->string);
}
+ fatalx("unexpected argument type");
}
/* Create an empty arguments set. */
@@ -130,8 +131,9 @@ args_parse(const struct args_parse *parse, struct args_value *values,
u_int i;
enum args_parse_type type;
struct args_value *value, *new;
- u_char flag, argument;
+ u_char flag;
const char *found, *string, *s;
+ int optional_argument;
if (count == 0)
return (args_create());
@@ -168,18 +170,27 @@ args_parse(const struct args_parse *parse, struct args_value *values,
args_free(args);
return (NULL);
}
- argument = *++found;
- if (argument != ':') {
+ if (*++found != ':') {
log_debug("%s: -%c", __func__, flag);
args_set(args, flag, NULL);
continue;
}
+ if (*found == ':') {
+ optional_argument = 1;
+ found++;
+ }
new = xcalloc(1, sizeof *new);
if (*string != '\0') {
new->type = ARGS_STRING;
new->string = xstrdup(string);
} else {
if (i == count) {
+ if (optional_argument) {
+ log_debug("%s: -%c", __func__,
+ flag);
+ args_set(args, flag, NULL);
+ continue;
+ }
xasprintf(cause,
"-%c expects an argument",
flag);
@@ -753,6 +764,7 @@ args_make_commands(struct args_command_state *state, int argc, char **argv,
case CMD_PARSE_SUCCESS:
return (pr->cmdlist);
}
+ fatalx("invalid parse return state");
}
/* Free commands state. */
@@ -819,6 +831,12 @@ args_strtonum(struct args *args, u_char flag, long long minval,
return (0);
}
value = TAILQ_LAST(&entry->values, args_values);
+ if (value == NULL ||
+ value->type != ARGS_STRING ||
+ value->string == NULL) {
+ *cause = xstrdup("missing");
+ return (0);
+ }
ll = strtonum(value->string, minval, maxval, &errstr);
if (errstr != NULL) {
@@ -830,6 +848,41 @@ args_strtonum(struct args *args, u_char flag, long long minval,
return (ll);
}
+/* Convert an argument value to a number, and expand formats. */
+long long
+args_strtonum_and_expand(struct args *args, u_char flag, long long minval,
+ long long maxval, struct cmdq_item *item, char **cause)
+{
+ const char *errstr;
+ char *formatted;
+ long long ll;
+ struct args_entry *entry;
+ struct args_value *value;
+
+ if ((entry = args_find(args, flag)) == NULL) {
+ *cause = xstrdup("missing");
+ return (0);
+ }
+ value = TAILQ_LAST(&entry->values, args_values);
+ if (value == NULL ||
+ value->type != ARGS_STRING ||
+ value->string == NULL) {
+ *cause = xstrdup("missing");
+ return (0);
+ }
+
+ formatted = format_single_from_target(item, value->string);
+ ll = strtonum(formatted, minval, maxval, &errstr);
+ free(formatted);
+ if (errstr != NULL) {
+ *cause = xstrdup(errstr);
+ return (0);
+ }
+
+ *cause = NULL;
+ return (ll);
+}
+
/* Convert an argument to a number which may be a percentage. */
long long
args_percentage(struct args *args, u_char flag, long long minval,
@@ -886,3 +939,70 @@ args_string_percentage(const char *value, long long minval, long long maxval,
*cause = NULL;
return (ll);
}
+
+/*
+ * Convert an argument to a number which may be a percentage, and expand
+ * formats.
+ */
+long long
+args_percentage_and_expand(struct args *args, u_char flag, long long minval,
+ long long maxval, long long curval, struct cmdq_item *item, char **cause)
+{
+ const char *value;
+ struct args_entry *entry;
+
+ if ((entry = args_find(args,