Overview
The tmux server manages clients, sessions, windows, and panes. Clients are attached to sessions to interact with them. Each session has one or more windows linked into it.attach-session
Alias:attach
target-session in the current terminal. If used from inside tmux, switch the currently attached session.
flag
Detach any other clients attached to the session.
flag
Do not apply the
update-environment option.flag
Alias for
-f read-only,ignore-size. Makes the client read-only.flag
Send SIGHUP to the parent process of the client as well as detaching, typically causing it to exit.
string
Set the session working directory (used for new windows) to
working-directory.string
Comma-separated list of client flags:
active-pane- client has an independent active paneignore-size- client does not affect the size of other clientsno-detach-on-destroy- do not detach when session is destroyed if other sessions existno-output- client does not receive pane output in control modepause-after=seconds- output is paused once pane is seconds behind in control moderead-only- client is read-onlywait-exit- wait for empty line input before exiting in control mode
! to turn a flag off if client is already attached.string
The target session. Must already exist.
Target Session Selection
When tmux needs to select the most recently used session, it prefers the most recently used unattached session.new-session
Alias:new
session-name.
flag
If
session-name already exists, behave like attach-session. When combined with -D, behaves like -d to attach-session, and with -X, behaves like -x to attach-session.flag
Do not attach the new session to the current terminal (create in detached mode).
flag
With
-A, detach other clients when attaching (like -d to attach-session).flag
Do not apply the
update-environment option.flag
Print information about the new session after it has been created. Default format is
#{session_name}: but can be changed with -F.flag
With
-A, send SIGHUP to parent process when attaching (like -x to attach-session).string
Specify the working directory for the new session.
string
Set an environment variable for the newly created session in the form
VARIABLE=value. May be specified multiple times.string
Comma-separated list of client flags (see
attach-session).string
Format for output when
-P is used.string
Name for the initial window.
string
Name for the new session.
string
Specify a session group. Sessions in the same group share the same set of windows. The argument may be:
- Name of an existing group
- Name of an existing session (new session joins same group)
- Name for a new group containing only the new session
-n or shell-command.number
Width for the session. Use
- for the size of the current client.number
Height for the session. Use
- for the size of the current client.string
Shell command to execute in the initial window.
Initial Size
With-d, the initial size comes from the default-size option. Use -x and -y to specify a different size. If -x or -y is given, the default-size option is set for the session.
detach-client
Alias:detach
-t, or all clients currently attached to the session specified by -s.
flag
Kill all clients except the client given with
-t.flag
Send SIGHUP to the parent process of the client, typically causing it to exit.
string
Run
shell-command to replace the client.string
Detach all clients attached to
target-session.string
The target client to detach.
has-session
Alias:has
string
The target session to check.
kill-session
flag
Kill all sessions except the specified one.
flag
Clear alerts (bell, activity, or silence) in all windows linked to the session.
string
The target session to destroy.
list-sessions
Alias:ls
flag
Reverse the sort order.
string
Specify the format of each line. See the FORMATS section.
string
Only show sessions for which the filter is true.
string
Specify sort order:
index, name, creation (time), or activity (time).rename-session
Alias:rename
new-name.
string
The target session to rename.
string
required
The new name for the session.
lock-session
Alias:locks
target-session.
string
The target session to lock.
kill-server
switch-client
Alias:switchc
flag
Do not apply the
update-environment option.flag
Move to the last session.
flag
Move to the next session.
flag
Move to the previous session.
flag
Toggle the client read-only flag.
flag
Keep the window zoomed if it was zoomed.
string
Specify the target client.
string
The target session.
string
Set the client’s key table to
key-table. The next key will be looked up in this table. Useful for creating custom key bindings.