summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/lock.yml2
-rw-r--r--CHANGES119
-rw-r--r--Makefile.am2
-rw-r--r--arguments.c63
-rw-r--r--cfg.c6
-rw-r--r--client.c39
-rw-r--r--cmd-attach-session.c17
-rw-r--r--cmd-bind-key.c2
-rw-r--r--cmd-break-pane.c24
-rw-r--r--cmd-capture-pane.c12
-rw-r--r--cmd-choose-tree.c11
-rw-r--r--cmd-command-prompt.c37
-rw-r--r--cmd-confirm-before.c37
-rw-r--r--cmd-copy-mode.c31
-rw-r--r--cmd-detach-client.c46
-rw-r--r--cmd-display-menu.c305
-rw-r--r--cmd-display-message.c32
-rw-r--r--cmd-display-panes.c40
-rw-r--r--cmd-find-window.c7
-rw-r--r--cmd-find.c31
-rw-r--r--cmd-if-shell.c79
-rw-r--r--cmd-join-pane.c69
-rw-r--r--cmd-kill-pane.c8
-rw-r--r--cmd-kill-server.c2
-rw-r--r--cmd-kill-session.c9
-rw-r--r--cmd-kill-window.c11
-rw-r--r--cmd-list-buffers.c28
-rw-r--r--cmd-list-clients.c7
-rw-r--r--cmd-list-keys.c18
-rw-r--r--cmd-list-panes.c35
-rw-r--r--cmd-list-sessions.c28
-rw-r--r--cmd-list-windows.c33
-rw-r--r--cmd-load-buffer.c10
-rw-r--r--cmd-lock-server.c19
-rw-r--r--cmd-move-window.c47
-rw-r--r--cmd-new-session.c40
-rw-r--r--cmd-new-window.c19
-rw-r--r--cmd-parse.y96
-rw-r--r--cmd-paste-buffer.c5
-rw-r--r--cmd-pipe-pane.c21
-rw-r--r--cmd-queue.c424
-rw-r--r--cmd-refresh-client.c73
-rw-r--r--cmd-rename-session.c8
-rw-r--r--cmd-rename-window.c11
-rw-r--r--cmd-resize-pane.c102
-rw-r--r--cmd-resize-window.c7
-rw-r--r--cmd-respawn-pane.c11
-rw-r--r--cmd-respawn-window.c12
-rw-r--r--cmd-rotate-window.c10
-rw-r--r--cmd-run-shell.c83
-rw-r--r--cmd-save-buffer.c14
-rw-r--r--cmd-select-layout.c11
-rw-r--r--cmd-select-pane.c50
-rw-r--r--cmd-select-window.c24
-rw-r--r--cmd-send-keys.c73
-rw-r--r--cmd-set-buffer.c4
-rw-r--r--cmd-set-environment.c32
-rw-r--r--cmd-set-option.c36
-rw-r--r--cmd-show-environment.c37
-rw-r--r--cmd-show-messages.c26
-rw-r--r--cmd-show-options.c43
-rw-r--r--cmd-source-file.c4
-rw-r--r--cmd-split-window.c17
-rw-r--r--cmd-swap-pane.c12
-rw-r--r--cmd-swap-window.c18
-rw-r--r--cmd-switch-client.c65
-rw-r--r--cmd-unbind-key.c2
-rw-r--r--cmd-wait-for.c6
-rw-r--r--cmd.c151
-rw-r--r--configure.ac8
-rw-r--r--control.c32
-rw-r--r--environ.c29
-rw-r--r--format-draw.c2
-rw-r--r--format.c216
-rw-r--r--grid.c48
-rw-r--r--input-keys.c115
-rw-r--r--input.c216
-rw-r--r--job.c100
-rw-r--r--key-bindings.c116
-rw-r--r--key-string.c7
-rw-r--r--layout-set.c43
-rw-r--r--menu.c85
-rw-r--r--mode-tree.c41
-rw-r--r--notify.c63
-rw-r--r--options-table.c85
-rw-r--r--osdep-darwin.c2
-rw-r--r--popup.c464
-rw-r--r--regress/capture-pane-sgr0.sh15
-rw-r--r--regsub.c3
-rw-r--r--screen-redraw.c19
-rw-r--r--screen-write.c436
-rw-r--r--screen.c186
-rw-r--r--server-client.c311
-rw-r--r--server-fn.c4
-rw-r--r--server.c17
-rw-r--r--spawn.c36
-rw-r--r--status.c4
-rw-r--r--tmux.1387
-rw-r--r--tmux.c57
-rw-r--r--tmux.h337
-rw-r--r--tty-acs.c2
-rw-r--r--tty-features.c268
-rw-r--r--tty-keys.c81
-rw-r--r--tty-term.c118
-rw-r--r--tty.c255
-rw-r--r--window-buffer.c3
-rw-r--r--window-copy.c188
-rw-r--r--window-tree.c6
-rw-r--r--window.c135
109 files changed, 5058 insertions, 2295 deletions
diff --git a/.github/lock.yml b/.github/lock.yml
index 89126482..08cf2fc0 100644
--- a/.github/lock.yml
+++ b/.github/lock.yml
@@ -1,4 +1,4 @@
-daysUntilLock: 180
+daysUntilLock: 30
skipCreatedBefore: false
exemptLabels: []
lockLabel: false
diff --git a/CHANGES b/CHANGES
index ec373fa3..9c02ca15 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,122 @@
+CHANGES FROM 3.1 TO 3.2
+
+* Add a -s flag to copy-mode to specify a different pane for the source
+ content. This means it is possible to view two places in a pane's history at
+ the same time in different panes, or view the history while still using the
+ pane. Pressing r refreshes the content from the source pane.
+
+* Add an argument to list-commands to show only a single command.
+
+* Change copy mode to make copy of the pane history so it does not need to
+ freeze the pane.
+
+* Restore pane_current_path format from portable tmux on OpenBSD.
+
+* Wait until the initial command sequence is done before sending a device
+ attributes request and other bits that prompt a reply from the terminal. This
+ means that stray relies are not left on the terminal if the command has
+ attached and then immediately detached and tmux will not be around to receive
+ them.
+
+* Add a -f filter argument to the list commands like choose-tree.
+
+* Move specific hooks for panes to pane options and windows for window options
+ rather than all hooks being session options. These hooks are now window options:
+
+ window-layout-changed
+ window-linked
+ window-pane-changed
+ window-renamed
+ window-unlinked
+
+ And these now pane options:
+
+ pane-died
+ pane-exited
+ pane-focus-in
+ pane-focus-out
+ pane-mode-changed
+ pane-set-clipboard
+
+ Any existing configurations using these hooks on a session rather than
+ globally (that is, set-hook or set-option without -g) may need to be changed.
+
+* Show signal names when a process exits with remain-on-exit on platforms which
+ have a way to get them.
+
+* Start menu with top item selected if no mouse and use mode-style for the
+ selected item.
+
+* Add a copy-command option and change copy-pipe and friends to pipe to it if
+ used without arguments, allows all the default copy key bindings to be
+ changed to pipe with one option rather than needing to change each key
+ binding individually.
+
+* Tidy up the terminal detection and feature code and add named sets of
+ terminal features, each of which are defined in one place and map to a
+ builtin set of terminfo(5) capabilities. Features can be specified based on
+ TERM with a new terminal-features option or with the -T flag when running
+ tmux. tmux will also detect a few common terminals from the DA and DSR
+ responses.
+
+ This is intended to make it easier to configure tmux's use of terminfo(5)
+ even in the presence of outdated ncurses(3) or terminfo(5) databases or for
+ features which do not yet have a terminfo(5) entry. Instead of having to grok
+ terminfo(5) capability names and what they should be set to in the
+ terminal-overrides option, the user can hopefully just give tmux a feature
+ name and let it do the right thing.
+
+ The terminal-overrides option remains both for backwards compatibility and to
+ allow tweaks of individual capabilities.
+
+* Support mintty's application escape sequence (means tmux doesn't have to
+ delay to wait for Escape, so no need to reduce escape-time when using
+ mintty).
+
+* Change so main-pane-width and height can be given as a percentage.
+
+* Support for the iTerm2 synchronized updates feature (allows the terminal to
+ avoid unnecessary drawing while output is still in progress).
+
+* Make the mouse_word and mouse_line formats work in copy mode and enable the
+ default pane menu in copy mode.
+
+* Add a -T flag to resize-pane to trim lines below the cursor, moving lines out
+ of the history.
+
+* Add a way to mark environment variables as "hidden" so they can be used by
+ tmux (for example in formats) but are not set in the environment for new
+ panes. set-environment and show-environment have a new -h flag and there is a
+ new %hidden statement for the configuration file.
+
+* Change default position for display-menu -x and -y to centre rather than top
+ left.
+
+* Add support for per-client transient popups, similar to menus. These are
+ created with new command display-popup. Popups may either show fixed text and
+ trigger a tmux command when a key is pressed, or run a program (-R flag).
+
+* Change double and triple click bindings so that only one is fired (previously
+ double click was fired on the way to triple click). Also add default double
+ and triple click bindings to copy the word or line under the cursor and
+ change the existing bindings in copy mode to do the same.
+
+* Add a default binding for button 2 to paste.
+
+* Add -d flag to run-shell to delay before running the command and allow it to
+ run without a command so it just delays.
+
+* Add C-g to cancel command prompt with vi keys as well as emacs, and q in
+ command mode.
+
+* When the server socket is given with -S, create it with umask 177 instead of
+ 117 (because it may not be in a safe directory like the default directory in
+ /tmp).
+
+* Add a copy-mode -H flag to hide the position marker in the top right.
+
+* Add number operators for formats (+, -, *, / and m),
+
CHANGES FROM 3.0a TO 3.1
* Only search the visible part of the history when marking (highlighting)
diff --git a/Makefile.am b/Makefile.am
index 082a467c..72b21f0a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -154,6 +154,7 @@ dist_tmux_SOURCES = \
options-table.c \
options.c \
paste.c \
+ popup.c \
proc.c \
regsub.c \
resize.c \
@@ -170,6 +171,7 @@ dist_tmux_SOURCES = \
tmux.c \
tmux.h \
tty-acs.c \
+ tty-features.c \
tty-keys.c \
tty-term.c \
tty.c \
diff --git a/arguments.c b/arguments.c
index e2d18980..e1956ace 100644
--- a/arguments.c
+++ b/arguments.c
@@ -215,8 +215,10 @@ args_escape(const char *s)
char *escaped, *result;
int flags;
- if (*s == '\0')
- return (xstrdup(s));
+ if (*s == '\0') {
+ xasprintf(&result, "''");
+ return (result);
+ }
if (s[0] != ' ' &&
(strchr(quoted, s[0]) != NULL || s[0] == '~') &&
s[1] == '\0') {
@@ -343,3 +345,60 @@ args_strtonum(struct args *args, u_char ch, long long minval, long long maxval,
*cause = NULL;
return (ll);
}
+
+/* Convert an argument to a number which may be a percentage. */
+long long
+args_percentage(struct args *args, u_char ch, long long minval,
+ long long maxval, long long curval, char **cause)
+{
+ const char *value;
+ struct args_entry *entry;
+
+ if ((entry = args_find(args, ch)) == NULL) {
+ *cause = xstrdup("missing");
+ return (0);
+ }
+ value = TAILQ_LAST(&entry->values, args_values)->value;
+ return (args_string_percentage(value, minval, maxval, curval, cause));
+}
+
+/* Convert a string to a number which may be a percentage. */
+long long
+args_string_percentage(const char *value, long long minval, long long maxval,
+ long long curval, char **cause)
+{
+ const char *errstr;
+ long long ll;
+ size_t valuelen = strlen(value);
+ char *copy;
+
+ if (value[valuelen - 1] == '%') {
+ copy = xstrdup(value);
+ copy[valuelen - 1] = '\0';
+
+ ll = strtonum(copy, 0, 100, &errstr);
+ free(copy);
+ if (errstr != NULL) {
+ *cause = xstrdup(errstr);
+ return (0);
+ }
+ ll = (curval * ll) / 100;
+ if (ll < minval) {
+ *cause = xstrdup("too large");
+ return (0);
+ }
+ if (ll > maxval) {
+ *cause = xstrdup("too small");
+ return (0);
+ }
+ } else {
+ ll = strtonum(value, minval, maxval, &errstr);
+ if (errstr != NULL) {
+ *cause = xstrdup(errstr);
+ return (0);
+ }
+ }
+
+ *cause = NULL;
+ return (ll);
+}
diff --git a/cfg.c b/cfg.c
index 933eda4e..312775eb 100644
-