aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-09-09 12:02:32 +0100
committerThomas Adam <thomas@xteddy.org>2019-09-09 12:02:32 +0100
commit2e90841f2ed4fbe0bb13681c9a90e355fe98ab1d (patch)
treed30661549b8e423251d749086316aaedc3d5c672
parent9a476c5f29d404128da070f2fe35a66bbe29ed9b (diff)
parentb31515fec36e8eb6eb57a75825e9840d8bd68a2e (diff)
downloadrtmux-2e90841f2ed4fbe0bb13681c9a90e355fe98ab1d.tar.gz
rtmux-2e90841f2ed4fbe0bb13681c9a90e355fe98ab1d.tar.bz2
rtmux-2e90841f2ed4fbe0bb13681c9a90e355fe98ab1d.zip
Merge branch 'obsd-master'
-rw-r--r--tmux.139
-rw-r--r--window-copy.c17
2 files changed, 37 insertions, 19 deletions
diff --git a/tmux.1 b/tmux.1
index 98f74b61..926433aa 100644
--- a/tmux.1
+++ b/tmux.1
@@ -296,6 +296,12 @@ Prompt to search for text in open windows.
Display some information about the current window.
.It l
Move to the previously selected window.
+.It m
+Mark the current pane (see
+.Ic select-pane
+.Fl m ) .
+.It M
+Clear the marked pane.
.It n
Change to the next window.
.It o
@@ -306,12 +312,6 @@ Change to the previous window.
Briefly display pane indexes.
.It r
Force redraw of the attached client.
-.It m
-Mark the current pane (see
-.Ic select-pane
-.Fl m ) .
-.It M
-Clear the marked pane.
.It s
Select a new session for the attached client interactively.
.It t
@@ -1156,7 +1156,7 @@ The
.Fl P
option prints information about the new session after it has been created.
By default, it uses the format
-.Ql #{session_name}:
+.Ql #{session_name}:\&
but a different format may be specified with
.Fl F .
.Pp
@@ -1450,6 +1450,7 @@ The following commands are supported in copy mode:
.It Li "copy-selection-no-clear [<prefix>]" Ta "" Ta ""
.It Li "copy-selection-and-cancel [<prefix>]" Ta "Enter" Ta "M-w"
.It Li "cursor-down" Ta "j" Ta "Down"
+.It Li "cursor-down-and-cancel" Ta "" Ta ""
.It Li "cursor-left" Ta "h" Ta "Left"
.It Li "cursor-right" Ta "l" Ta "Right"
.It Li "cursor-up" Ta "k" Ta "Up"
@@ -4091,7 +4092,7 @@ will append
if the pane title is more than five characters.
.Pp
Prefixing a time variable with
-.Ql t:
+.Ql t:\&
will convert it to a string, so if
.Ql #{window_activity}
gives
@@ -4100,34 +4101,34 @@ gives
gives
.Ql Sun Oct 25 09:25:02 2015 .
The
-.Ql b:
+.Ql b:\&
and
-.Ql d:
+.Ql d:\&
prefixes are
.Xr basename 3
and
.Xr dirname 3
of the variable respectively.
-.Ql q:
+.Ql q:\&
will escape
.Xr sh 1
special characters.
-.Ql E:
+.Ql E:\&
will expand the format twice, for example
.Ql #{E:status-left}
is the result of expanding the content of the
.Ic status-left
option rather than the option itself.
-.Ql T:
+.Ql T:\&
is like
-.Ql E:
+.Ql E:\&
but also expands
.Xr strftime 3
specifiers.
-.Ql S: ,
-.Ql W:
+.Ql S:\& ,
+.Ql W:\&
or
-.Ql P:
+.Ql P:\&
will loop over each session, window or pane and insert the format once
for each.
For windows and panes, two comma-separated formats may be given:
@@ -4138,7 +4139,7 @@ For example, to get a list of windows formatted like the status line:
.Ed
.Pp
A prefix of the form
-.Ql s/foo/bar/:
+.Ql s/foo/bar/:\&
will substitute
.Ql foo
with
@@ -4147,7 +4148,7 @@ throughout.
The first argument may be an extended regular expression and a final argument may be
.Ql i
to ignore case, for example
-.Ql s/a(.)/\e1x/i:
+.Ql s/a(.)/\e1x/i:\&
would change
.Ql abABab
into
diff --git a/window-copy.c b/window-copy.c
index c7c44fe9..b90130c7 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -820,6 +820,21 @@ window_copy_cmd_cursor_down(struct window_copy_cmd_state *cs)
}
static enum window_copy_cmd_action
+window_copy_cmd_cursor_down_and_cancel(struct window_copy_cmd_state *cs)
+{
+ struct window_mode_entry *wme = cs->wme;
+ struct window_copy_mode_data *data = wme->data;
+ u_int np = wme->prefix, cy;
+
+ cy = data->cy;
+ for (; np != 0; np--)
+ window_copy_cursor_down(wme, 0);
+ if (cy == data->cy && data->oy == 0)
+ return (WINDOW_COPY_CMD_CANCEL);
+ return (WINDOW_COPY_CMD_NOTHING);
+}
+
+static enum window_copy_cmd_action
window_copy_cmd_cursor_left(struct window_copy_cmd_state *cs)
{
struct window_mode_entry *wme = cs->wme;
@@ -1810,6 +1825,8 @@ static const struct {
window_copy_cmd_copy_selection_and_cancel },
{ "cursor-down", 0, 0,
window_copy_cmd_cursor_down },
+ { "cursor-down-and-cancel", 0, 0,
+ window_copy_cmd_cursor_down_and_cancel },
{ "cursor-left", 0, 0,
window_copy_cmd_cursor_left },
{ "cursor-right", 0, 0,