diff options
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 @@ -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 - |