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.
Detach any other clients attached to the session.
Do not apply the
update-environment option.Alias for
-f read-only,ignore-size. Makes the client read-only.Send SIGHUP to the parent process of the client as well as detaching, typically causing it to exit.
Set the session working directory (used for new windows) to
working-directory.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.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.
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.Do not attach the new session to the current terminal (create in detached mode).
With
-A, detach other clients when attaching (like -d to attach-session).Do not apply the
update-environment option.Print information about the new session after it has been created. Default format is
#{session_name}: but can be changed with -F.With
-A, send SIGHUP to parent process when attaching (like -x to attach-session).Specify the working directory for the new session.
Set an environment variable for the newly created session in the form
VARIABLE=value. May be specified multiple times.Comma-separated list of client flags (see
attach-session).Format for output when
-P is used.Name for the initial window.
Name for the new session.
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.Width for the session. Use
- for the size of the current client.Height for the session. Use
- for the size of the current client.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.
Kill all clients except the client given with
-t.Send SIGHUP to the parent process of the client, typically causing it to exit.
Run
shell-command to replace the client.Detach all clients attached to
target-session.The target client to detach.
has-session
Alias:has
The target session to check.
kill-session
Kill all sessions except the specified one.
Clear alerts (bell, activity, or silence) in all windows linked to the session.
The target session to destroy.
list-sessions
Alias:ls
Reverse the sort order.
Specify the format of each line. See the FORMATS section.
Only show sessions for which the filter is true.
Specify sort order:
index, name, creation (time), or activity (time).rename-session
Alias:rename
new-name.
The target session to rename.
The new name for the session.
lock-session
Alias:locks
target-session.
The target session to lock.
kill-server
switch-client
Alias:switchc
Do not apply the
update-environment option.Move to the last session.
Move to the next session.
Move to the previous session.
Toggle the client read-only flag.
Keep the window zoomed if it was zoomed.
Specify the target client.
The target session.
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.