aboutsummaryrefslogtreecommitdiff
path: root/tmux.1
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-07-13 17:47:46 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-07-13 17:47:46 +0000
commit023d8d38ec7d59bbf635253f10e82e0b62ba59ca (patch)
treef2ca407f1d6e72543177cfa7b65fa45fd2e5737c /tmux.1
parent359285928b63605a130990699c33c8af42be9fd2 (diff)
downloadrtmux-023d8d38ec7d59bbf635253f10e82e0b62ba59ca.tar.gz
rtmux-023d8d38ec7d59bbf635253f10e82e0b62ba59ca.tar.bz2
rtmux-023d8d38ec7d59bbf635253f10e82e0b62ba59ca.zip
Tidy up and improve target (-t) argument parsing:
- move the code back into cmd.c and merge with the existing functions where possible; - accept "-tttyp0" as well as "-t/dev/ttyp0" for clients; - when looking up session names, try an exact match first, and if that fails look for it as an fnmatch pattern and then as the start of a name - if more that one session matches an error is given; so if there is one session called "mysession", -tmysession, -tmysess, -tmysess* are equivalent but if there is also "mysession2", the last two are errors; - similarly for windows, if the argument is not a valid index or exact window name match, try it against the window names as an fnmatch pattern and a prefix.
Diffstat (limited to 'tmux.1')
-rw-r--r--tmux.141
1 files changed, 28 insertions, 13 deletions
diff --git a/tmux.1 b/tmux.1
index e3965c7a..552907b0 100644
--- a/tmux.1
+++ b/tmux.1
@@ -500,8 +500,14 @@ These specify the client, session or window which a command should affect.
.Ar target-client
is the name of the
.Xr pty 4
-file to which the client is connected, for example
+file to which the client is connected, for example either of
+.Pa /dev/ttyp1
+or
+.Pa ttyp1
+for the client attached to
.Pa /dev/ttyp1 .
+If no client is specified, the current client is chosen, if possible, or an
+error is reported.
Clients may be listed with the
.Ic list-clients
command.
@@ -509,23 +515,32 @@ command.
.Ar target-session
is either the name of a session (as listed by the
.Ic list-sessions
-command) or the name of a client,
+command) or the name of a client with the same syntax as
.Ar target-client ,
in which case the session attached to the client is used.
-An
+When looking for the session name,
+.Nm
+initially searches for an exact match; if none is found, the session names
+are checked for any for which
+.Ar target-session
+is a prefix or for which it matches as an
.Xr fnmatch 3
-pattern may be used to match the session name.
-If a session is omitted when required,
-.Nm tmux
-attempts to use the current session; if no current session is available, the
-most recently created is chosen.
-If no client is specified, the current client is chosen, if possible, or an
-error is reported.
+pattern.
+If a single match is found, it is used as the target session; multiple matches
+produce an error
+If a session is omitted, the current session is used if available; if no
+current session is available, the most recently created is chosen.
.Pp
.Ar target-window
specifies a window in the form
-.Em session Ns \&: Ns Em index ,
-for example mysession:1.
+.Em session Ns \&: Ns Em window ,
+where
+.Em window
+is a window index, for example mysession:1, or a window name,
+.Xr fnmatch 3
+pattern, or prefix, such as mysession:mywin[0-3].
+If the latter, the window is looked up in a similar fashion to session name
+searches described above.
The session is in the same form as for
.Ar target-session .
.Em session ,
@@ -536,7 +551,7 @@ If
is omitted, the same rules as for
.Ar target-session
are followed; if
-.Em index
+.Em window
is not present, the current window for the given session is used.
When the argument does not contain a colon,
.Nm