neulab/tldr huggingface dataset:
%S Print the start time of the appointment or the marker ..:..  if it begins before midnight
Events %m Print the description of the item
Todo items %m Print the description of the item
%p Print the priority of the item
Extended format specifiers Extended format specifiers can be used to control the printing of times for some of the single-letter specifiers. Additionally there are two specifiers that do not have any corresponding short form and are intended for use in scripting.
%(duration[:format]) extended form of %d
%(remaining[:format]) extended form of %r
format may contain any of the strftime(3) specifiers %d, %H, %M or %S with the following modifications: 1) days are not limited to the "calendar" values 0-31 (hours, minutes and seconds are "clock" values, but see E in the following) 2) each number is by default padded with zeros to two decimal places, 3) the % character may be followed by one or two optional flags: -, which suppresses the zero-padding, E, which will suppress the "clock" limits on %H, %M and %S; if both are used, - must precede E, 4) no other flags or width specifications are supported
%(start[:format]) extended form of %s
%(end[:format]) extended form of %e
format may be any strftime(3) format specifier or one of the strings epoch or default; the former is equivalent to the (calcurse) specifiers %s and %e (seconds since the Epoch); the latter is equivalent to the (calcurse) specifiers %S and %E or the (strftime) format string %H:%M, except that the continuation marker ..:..  is printed if the start/end time belongs to another day
%(raw) the text file format of an item as saved on disk; the default format for the grep and dump-imported options; can be used with all format options
%(hash) the (SHA1) hash of the above; can be used with all format options
calcurse -d tomorrow Display the calendar for tomorrow (same as calcurse -Q --filter-type cal --from tomorrow).
calcurse -d friday Display the calendar for the upcoming friday.
calcurse -d 7 Display the calendar for the next seven days (same as calcurse -Q -filter-type cal --days 7).
calcurse -r7 --format-apt " - %S -> %E\n\t%m\n%N" Print appointments and events for the next seven days. Also, print the notes attached to each regular appointment.
calcurse -r7 --format-apt " - %m (%S to %E)\n" --format-recur-apt " - %m (%S to %E)\n" Print appointments and events for the next seven days and use a custom format for (recurrent) appointments:
- Some appointment (18:30 to 21:30)
calcurse -t --format-todo "(%p) %m\n" List all todo items and put parentheses around the priority specifiers.
If the calcurse data files contain many entries which are no longer needed or wanted, they can, of course, be removed interactively. If there are many, it can be a tedious task and may be done better as in the following two examples.
calcurse --input-datefmt 4 -G --filter-start-before 2015-1-1 List event and appointment entries in the data files with a start time before 1 January 2015, and all TODO entries.
Purge. When -G is replaced by -P, those entries are removed. This may remove recurring items that have occurrences after 1 January 2015.
calcurse --input-datefmt 1 -G --filter-start-from 11/1/2015 --filter-type event,apt List (ordinary) event and appointment entries with a start time of 1 November 2015 or later.
calcurse -G --filter-type apt --format-apt "%(hash) %m\n" For each appointment list the SHA1 hash of the data file entry followed by the description.
calcurse -G --filter-type apt --format-apt "%(duration:%d/%EH/%EM)\t%m\n" For each appointment list the (total) duration as either days, hours or minutes followed by the description.
calcurse -G --filter-type apt --format-apt "%(start:%c) %(duration:%d %H:%M)\t%m\n" For each appointment list the start time in a localized standard format, followed by the duration in days, hours and minutes, followed by the description.
The following structure is created by default in your home directory the first time calcurse is run without any options:
$XDG_DATA_HOME/calcurse/        $XDG_CONFIG_HOME/calcurse/ |___apts                          |___conf |___notes/                        |___hooks/ |___todo                          |___keys
$XDG_DATA_HOME defaults to $HOME/.local/share and $XDG_CONFIG_HOME defaults to $HOME/.config.
The files are of two different kinds: data and configuration. The data files constitute the calcurse database and are independent of the calcurse release version; the configuration files depend on the calcurse version although backwards compatibility is always aimed at.
Data files The calendar file apts contains all of the user’s appointments and events, and the todo file contains the todo list. The notes subdirectory contains the notes which are attached to appointments, events or todos. One text file is created per note, whose name is the SHA1 message digest of the note itself.
The (hidden) lock files of the calcurse (.calcurse.pid) and daemon (.daemon.log) programs are present when they are running. If daemon log activity has been enabled in the notification configuration menu, the file daemon.log is present.
An alternative calendar file may be specified with the -c option.
Configuration files The conf file contains the user configuration and the keys file the user-defined key bindings. The hooks directory contains user-supplied scripts, see Hooks.
Directory configuration An alternative directory for both the configuration files and the data directory may be specified with the -D option.
An alternative directory for the configuration files only may be specified with the -C option; in that case data files are either in the default directory or in the directory specified by -D. If both -D and -C are present, configuration files in the data directory, if any, are ignored.
If $HOME/.calcurse exists, then it will be used as the default for both the data directory and the configuration directory.
<datadir>      <confdir> |             | |__ apts      |___ conf |__ todo      |___ keys |__ notes/    |___ hooks/
defaults: <datadir>: $XDG_DATA_HOME/calcurse ($HOME/.local/share/calcurse) <confdir>: $XDG_CONFIG_HOME/calcurse ($HOME/.config/calcurse) both: $HOME/.calcurse (only if it exists)
calcurse may switch between two configuration setups, but still access the same data files e.g. with:
$ calcurse
$ calcurse -C "$HOME/.config/calcurse/config"
Hooks Scripts placed in <confdir>/calcurse/hooks/ (see Directory configuration) trigger actions at certain events. To enable a hook, add a script with one of the following names to this directory. Also make sure the script is executable.
pre-load Executed before the data files are loaded.
post-load Executed after the data files are loaded.
pre-save Executed before the data files are saved.
post-save Executed after the data files are saved.
Some examples can be found in the contrib/hooks/ directory of the calcurse source tree.
A few environment variables affect how calcurse operates.
CALCURSE_EDITOR, VISUAL, EDITOR Specifies the external editor to use for writing notes. They are tried in the order listed until one is found. If none of them are set, vi is used.
CALCURSE_PAGER, PAGER Specifies - as for the editor - the default viewer to be used for reading notes. Default is less.
MERGETOOL Tool used to merge two files to solve a save conflict. Default is vimdiff. The program is called with two file names as the only arguments.
See also FILES.
If you find a bug, please send a report to bugs@calcurse.org, or, if you are a Github user, raise an issue at https://github.com/lfos/calcurse.
The ical specification (rfc2445) can be found at: http://tools.ietf.org/html/rfc2445
The pcal project page: http://pcal.sourceforge.net/
calcurse home page: http://calcurse.org/
calcurse at GitHub: https://github.com/lfos/calcurse
The complete manual, maintained in html format, can be found in the doc/ directory of the source package, or at: http://calcurse.org/files/manual.html
•   Frederic Culot <frederic@culot.org>
•   Lukas Fleischer <lfleischer@calcurse.org>
Copyright (c) 2004-2020 calcurse Development Team. This software is released under the BSD License.
TMUX(1)                    BSD General Commands Manual                   TMUX(1)
tmux — terminal multiplexer
tmux [-2CDluvV] [-c shell-command] [-f file] [-L socket-name] [-S socket-path] [-T features] [command [flags]]
tmux is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen.  tmux may be detached from a screen and continue running in the background, then later reattached.
When tmux is started it creates a new session with a single window and displays it on screen.  A status line at the bottom of the screen shows information on the current session and is used to enter interactive commands.
A session is a single collection of pseudo terminals under the management of tmux.  Each session has one or more windows linked to it.  A window occupies the entire screen and may be split into rectangular panes, each of which is a separate pseudo terminal (the pty(4) manual page documents the technical details of pseudo terminals).  Any number of tmux instances may connect to the same session, and any number of windows may be present in the same session.  Once all sessions are killed, tmux exits.
Each session is persistent and will survive accidental disconnection (such as ssh(1) connection timeout) or intentional detaching (with the ‘C-b d’ key strokes).  tmux may be reattached using:
$ tmux attach
In tmux, a session is displayed on screen by a client and all sessions are managed by a single server.  The server and each client are separate processes which communicate through a socket in /tmp.
-2            Force tmux to assume the terminal supports 256 colours.  This is equivalent to -T 256.
-C            Start in control mode (see the CONTROL MODE section).  Given twice (-CC) disables echo.
-c shell-command Execute shell-command using the default shell.  If necessary, the tmux server will be started to retrieve the default-shell option.  This option is for compatibility with sh(1) when tmux is used as a login shell.
-D            Do not start the tmux server as a daemon.  This also turns the exit-empty option off.  With -D, command may not be specified.
-f file       Specify an alternative configuration file.  By default, tmux loads the system configuration file from /etc/tmux.conf, if present, then looks for a user configuration file at ~/.tmux.conf.
The configuration file is a set of tmux commands which are executed in sequence when the server is first started.  tmux loads configuration files once when the server process has started.  The source-file command may be used to load a file later.
tmux shows any error messages from commands in configuration files in the first session created, and continues to process the rest of the configuration file.
-L socket-name tmux stores the server socket in a directory under TMUX_TMPDIR or /tmp if it is unset.  The default socket is named default.  This option allows a different socket name to be specified, allowing several independent tmux servers to be run.  Unlike -S a full path is not necessary: the sockets are all created in a directory tmux-UID under the directory given by TMUX_TMPDIR or in /tmp.  The tmux-UID directory is created by tmux and must not be world readable, writable or executable.
If the socket is accidentally removed, the SIGUSR1 signal may be sent to the tmux server process to recreate it (note that this will fail if any parent directories are missing).
-l            Behave as a login shell.  This flag currently has no effect and is for compatibility with other shells when using tmux as a login shell.
-N            Do not start the server even if the command would normally do so (for example new-session or start-server).
-S socket-path Specify a full alternative path to the server socket.  If -S is specified, the default socket directory is not used and any -L flag is ignored.
-u            Write UTF-8 output to the terminal even if the first environment variable of LC_ALL, LC_CTYPE, or LANG that is set does not contain "UTF-8" or "UTF8".  This is equivalent to -T UTF-8.
-T features   Set terminal features for the client.  This is a comma- separated list of features.  See the terminal-features option.
-v            Request verbose logging.  Log messages will be saved into tmux-client-PID.log and tmux-server-PID.log files in the current directory, where PID is the PID of the server or client process.  If -v is specified twice, an additional tmux-out-PID.log file is generated with a copy of everything tmux writes to the terminal.
The SIGUSR2 signal may be sent to the tmux server process to toggle logging between on (as if -v was given) and off.
-V            Report the tmux version.
command [flags] This specifies one of a set of commands used to control tmux, as described in the following sections.  If no commands are specified, the new-session command is assumed.
tmux may be controlled from an attached client by using a key combination of a prefix key, ‘C-b’ (Ctrl-b) by default, followed by a command key.
The default command key bindings are:
C-b         Send the prefix key (C-b) through to the application. C-o         Rotate the panes in the current window forwards. C-z         Suspend the tmux client. !           Break the current pane out of the window. "           Split the current pane into two, top and bottom. #           List all paste buffers. $           Rename the current session. %           Split the current pane into two, left and right. &           Kill the current window. '           Prompt for a window index to select. (           Switch the attached client to the previous session. )           Switch the attached client to the next session. ,           Rename the current window. -           Delete the most recently copied buffer of text. .           Prompt for an index to move the current window. 0 to 9      Select windows 0 to 9. :           Enter the tmux command prompt. ;           Move to the previously active pane. =           Choose which buffer to paste interactively from a list. ?           List all key bindings. D           Choose a client to detach. L           Switch the attached client back to the last session. [           Enter copy mode to copy text or view the history. ]           Paste the most recently copied buffer of text. c           Create a new window. d           Detach the current client. f           Prompt to search for text in open windows. i           Display some information about the current window. l           Move to the previously selected window. m           Mark the current pane (see select-pane -m). M           Clear the marked pane. n           Change to the next window. o           Select the next pane in the current window. p           Change to the previous window. q           Briefly display pane indexes. r           Force redraw of the attached client. s           Select a new session for the attached client interactively. t           Show the time. w           Choose the current window interactively. x           Kill the current pane. z           Toggle zoom state of the current pane. {           Swap the current pane with the previous pane. }           Swap the current pane with the next pane. ~           Show previous messages from tmux, if any. Page Up     Enter copy mode and scroll one page up. Up, Down Left, Right Change to the pane above, below, to the left, or to the right of the current pane. M-1 to M-5  Arrange panes in one of the five preset layouts: even- horizontal, even-vertical, main-horizontal, main- vertical, or tiled. Space       Arrange the current window in the next preset layout. M-n         Move to the next window with a bell or activity marker. M-o         Rotate the panes in the current window backwards. M-p         Move to the previous window with a bell or activity marker. C-Up, C-Down C-Left, C-Right Resize the current pane in steps of one cell. M-Up, M-Down M-Left, M-Right Resize the current pane in steps of five cells.
Key bindings may be changed with the bind-key and unbind-key commands.
tmux supports a large number of commands which can be used to control its behaviour.  Each command is named and can accept zero or more flags and arguments.  They may be bound to a key with the bind-key command or run from the shell prompt, a shell script, a configuration file or the command prompt.  For example, the same set-option command run from the shell prompt, from ~/.tmux.conf and bound to a key may look like:
$ tmux set-option -g status-style bg=cyan
set-option -g status-style bg=cyan
bind-key C set-option -g status-style bg=cyan
Here, the command name is ‘set-option’, ‘-g’ is a flag and ‘status-style’ and ‘bg=cyan’ are arguments.
tmux distinguishes between command parsing and execution.  In order to execute a command, tmux needs it to be split up into its name and arguments.  This is command parsing.  If a command is run from the shell, the shell parses it; from inside tmux or from a configuration file, tmux does.  Examples of when tmux parses commands are:
-   in a configuration file;
-   typed at the command prompt (see command-prompt);
-   given to bind-key;
-   passed as arguments to if-shell or confirm-before.
To execute commands, each client has a ‘command queue’.  A global command queue not attached to any client is used on startup for configuration files like ~/.tmux.conf.  Parsed commands added to the queue are executed in order.  Some commands, like if-shell and confirm-before, parse their argument to create a new command which is inserted immediately after themselves.  This means that arguments can be parsed twice or more - once when the parent command (such as if-shell) is parsed and again when it parses and executes its command.  Commands like if-shell, run-shell and display-panes stop execution of subsequent commands on the queue until something happens - if-shell and run-shell until a shell command finishes and display-panes until a key is pressed.  For example, the following commands:
new-session; new-window if-shell "true" "split-window" kill-session
Will execute new-session, new-window, if-shell, the shell command true(1), split-window and kill-session in that order.
The COMMANDS section lists the tmux commands and their arguments.
This section describes the syntax of commands parsed by tmux, for example in a configuration file or at the command prompt.  Note that when commands are entered into the shell, they are parsed by the shell - see for example ksh(1) or csh(1).
Each command is terminated by a newline or a semicolon (;).  Commands separated by semicolons together form a ‘command sequence’ - if a command in the sequence encounters an error, no subsequent commands are executed.
It is recommended that a semicolon used as a command separator should be written as an individual token, for example from sh(1):
$ tmux neww \; splitw
$ tmux neww ';' splitw
Or from the tmux command prompt:
neww ; splitw
However, a trailing semicolon is also interpreted as a command separator, for example in these sh(1) commands:
$ tmux neww\\; splitw
$ tmux 'neww;' splitw
As in these examples, when running tmux from the shell extra care must be taken to properly quote semicolons:
1.   Semicolons that should be interpreted as a command separator should be escaped according to the shell conventions.  For sh(1) this typically means quoted (such as ‘neww ';' splitw’) or escaped (such as ‘neww \\\\; splitw’).
2.   Individual semicolons or trailing semicolons that should be interpreted as arguments should be escaped twice: once according to the shell conventions and a second time for tmux; for example:
$ tmux neww 'foo\\;' bar $ tmux neww foo\\\\; bar
3.   Semicolons that are not individual tokens or trailing another token should only be escaped once according to shell conventions; for example:
$ tmux neww 'foo-;-bar' $ tmux neww foo-\\;-bar
Comments are marked by the unquoted # character - any remaining text after a comment is ignored until the end of the line.
If the last character of a line is \, the line is joined with the following line (the \ and the newline are completely removed).  This is called line continuation and applies both inside and outside quoted strings and in comments, but not inside braces.
Command arguments may be specified as strings surrounded by single (') quotes, double quotes (") or braces ({}).  This is required when the argument contains any special character.  Single and double quoted strings cannot span multiple lines except with line continuation.  Braces can span multiple lines.
Outside of quotes and inside double quotes, these replacements are performed:
-   Environment variables preceded by $ are replaced with their value from the global environment (see the GLOBAL AND SESSION ENVIRONMENT section).
-   A leading ~ or ~user is expanded to the home directory of the current or specified user.
-   \uXXXX or \uXXXXXXXX is replaced by the Unicode codepoint corresponding to the given four or eight digit hexadecimal number.
-   When preceded (escaped) by a \, the following characters are replaced: \e by the escape character; \r by a carriage return; \n by a newline; and \t by a tab.
-   \ooo is replaced by a character of the octal value ooo.  Three octal digits are required, for example \001.  The largest valid character is \377.
-   Any other characters preceded by \ are replaced by themselves (that is, the \ is removed) and are not treated as having any special meaning - so for example \; will not mark a command sequence and \$ will not expand an environment variable.
Braces are parsed as a configuration file (so conditions such as ‘%if’ are processed) and then converted into a string.  They are designed to avoid the need for additional escaping when passing a group of tmux commands as an argument (for example to if-shell).  These two examples produce an identical command - note that no escaping is needed when using {}:
if-shell true { display -p 'brace-dollar-foo: }$foo' }
if-shell true "display -p 'brace-dollar-foo: }\$foo'"
Braces may be enclosed inside braces, for example:
bind x if-shell "true" { if-shell "true" { display "true!" } }
Environment variables may be set by using the syntax ‘name=value’, for example ‘HOME=/home/user’.  Variables set during parsing are added to the global environment.  A hidden variable may be set with ‘%hidden’, for example:
%hidden MYVAR=42
Hidden variables are not passed to the environment of processes created by tmux.  See the GLOBAL AND SESSION ENVIRONMENT section.
Commands may be parsed conditionally by surrounding them with ‘%if’, ‘%elif’, ‘%else’ and ‘%endif’.  The argument to ‘%if’ and ‘%elif’ is expanded as a format (see FORMATS) and if it evaluates to false (zero or empty), subsequent text is ignored until the closing ‘%elif’, ‘%else’ or ‘%endif’.  For example:
%if "#{==:#{host},myhost}" set -g status-style bg=red %elif "#{==:#{host},myotherhost}" set -g status-style bg=green %else set -g status-style bg=blue %endif
Will change the status line to red if running on ‘myhost’, green if running on ‘myotherhost’, or blue if running on another host.  Conditionals may be given on one line, for example:
%if #{==:#{host},myhost} set -g status-style bg=red %endif
This section describes the commands supported by tmux.  Most commands accept the optional -t (and sometimes -s) argument with one of target-client, target-session, target-window, or target-pane.  These specify the client, session, window or pane which a command should affect.
target-client should be the name of the client, typically the pty(4) file to which the client is connected, for example either of /dev/ttyp1 or ttyp1 for the client attached to /dev/ttyp1.  If no client is specified, tmux attempts to work out the client currently in use; if that fails, an error is reported.  Clients may be listed with the list-clients command.
target-session is tried as, in order:
1.   A session ID prefixed with a $.
2.   An exact name of a session (as listed by the list-sessions command).
3.   The start of a session name, for example ‘mysess’ would match a session named ‘mysession’.
4.   An fnmatch(3) pattern which is matched against the session name.
If the session name is prefixed with an ‘=’, only an exact match is accepted (so ‘=mysess’ will only match exactly ‘mysess’, not ‘mysession’).
If a single session 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 used is chosen.
target-window (or src-window or dst-window) specifies a window in the form session:window.  session follows the same rules as for target-session, and window is looked for in order as:
1.   A special token, listed below.
2.   A window index, for example ‘mysession:1’ is window 1 in session ‘mysession’.
3.   A window ID, such as @1.
4.   An exact window name, such as ‘mysession:mywindow’.
5.   The start of a window name, such as ‘mysession:mywin’.
6.   As an fnmatch(3) pattern matched against the window name.
Like sessions, a ‘=’ prefix will do an exact match only.  An empty window name specifies the next unused index if appropriate (for example the new-window and link-window commands) otherwise the current window in session is chosen.
The following special tokens are available to indicate particular windows. Each has a single-character alternative form.
Token              Meaning {start}       ^    The lowest-numbered window {end}         $    The highest-numbered window {last}        !    The last (previously current) window {next}        +    The next window by number {previous}    -    The previous window by number
target-pane (or src-pane or dst-pane) may be a pane ID or takes a similar form to target-window but with the optional addition of a period followed by a pane index or pane ID, for example: ‘mysession:mywindow.1’.  If the pane index is omitted, the currently active pane in the specified window is used.  The following special tokens are available for the pane index:
Token                  Meaning {last}            !    The last (previously active) pane {next}            +    The next pane by number {previous}        -    The previous pane by number {top}                  The top pane {bottom}               The bottom pane {left}                 The leftmost pane {right}                The rightmost pane {top-left}             The top-left pane {top-right}            The top-right pane {bottom-left}          The bottom-left pane {bottom-right}         The bottom-right pane {up-of}                The pane above the active pane {down-of}              The pane below the active pane {left-of}              The pane to the left of the active pane {right-of}             The pane to the right of the active pane
The tokens ‘+’ and ‘-’ may be followed by an offset, for example:
select-window -t:+2
In addition, target-session, target-window or target-pane may consist entirely of the token ‘{mouse}’ (alternative form ‘=’) to specify the session, window or pane where the most recent mouse event occurred (see the MOUSE SUPPORT section) or ‘{marked}’ (alternative form ‘~’) to specify the marked pane (see select-pane -m).
Sessions, window and panes are each numbered with a unique ID; session IDs are prefixed with a ‘$’, windows with a ‘@’, and panes with a ‘%’.  These are unique and are unchanged for the life of the session, window or pane in the tmux server.  The pane ID is passed to the child process of the pane in the TMUX_PANE environment variable.  IDs may be displayed using the ‘session_id’, ‘window_id’, or ‘pane_id’ formats (see the FORMATS section) and the display-message, list-sessions, list-windows or list-panes commands.
shell-command arguments are sh(1) commands.  This may be a single argument passed to the shell, for example:
new-window 'vi ~/.tmux.conf'
Will run:
/bin/sh -c 'vi ~/.tmux.conf'
Additionally, the new-window, new-session, split-window, respawn-window and respawn-pane commands allow shell-command to be given as multiple arguments and executed directly (without ‘sh -c’).  This can avoid issues with shell quoting.  For example:
$ tmux new-window vi ~/.tmux.conf
Will run vi(1) directly without invoking the shell.
command [arguments] refers to a tmux command, either passed with the command and arguments separately, for example:
bind-key F1 set-option status off
Or passed as a single string argument in .tmux.conf, for example:
bind-key F1 { set-option status off }
Example tmux commands include:
refresh-client -t/dev/ttyp2
rename-session -tfirst newname
set-option -wt:0 monitor-activity on
new-window ; split-window -d
bind-key R source-file ~/.tmux.conf \; \ display-message "source-file done"
Or from sh(1):
$ tmux kill-window -t :1
$ tmux new-window \; split-window -d
$ tmux new-session -d 'vi ~/.tmux.conf' \; split-window -d \; attach
The tmux server manages clients, sessions, windows and panes.  Clients are attached to sessions to interact with them, either when they are created with the new-session command, or later with the attach-session command. Each session has one or more windows linked into it.  Windows may be linked to multiple sessions and are made up of one or more panes, each of which contains a pseudo terminal.  Commands for creating, linking and otherwise manipulating windows are covered in the WINDOWS AND PANES section.
The following commands are available to manage clients and sessions:
attach-session [-dErx] [-c working-directory] [-f flags] [-t target-session] (alias: attach) If run from outside tmux, create a new client in the current terminal and attach it to target-session.  If used from inside, switch the current client.  If -d is specified, any other clients attached to the session are detached.  If -x is given, send SIGHUP to the parent process of the client as well as detaching the client, typically causing it to exit.  -f sets a comma-separated list of client flags.  The flags are:
active-pane the client has an independent active pane
ignore-size the client does not affect the size of other clients
no-output the client does not receive pane output in control mode
pause-after=seconds output is paused once the pane is seconds behind in control mode
read-only the client is read-only
wait-exit wait for an empty line input before exiting in control mode
A leading ‘!’ turns a flag off if the client is already attached. -r is an alias for -f read-only,ignore-size.  When a client is read-only, only keys bound to the detach-client or switch-client commands have any effect.  A client with the active-pane flag allows the active pane to be selected independently of the window's active pane used by clients without the flag.  This only affects the cursor position and commands issued from the client; other features such as hooks and styles continue to use the window's active pane.
If no server is started, attach-session will attempt to start it; this will fail unless sessions are created in the configuration file.
The target-session rules for attach-session are slightly adjusted: if tmux needs to select the most recently used session, it will prefer the most recently used unattached session.
-c will set the session working directory (used for new windows) to working-directory.
If -E is used, the update-environment option will not be applied.
detach-client [-aP] [-E shell-command] [-s target-session] [-t target-client] (alias: detach) Detach the current client if bound to a key, the client specified with -t, or all clients currently attached to the session specified by -s.  The -a option kills all but the client given with -t.  If -P is given, send SIGHUP to the parent process of the client, typically causing it to exit.  With -E, run shell-command to replace the client.
has-session [-t target-session] (alias: has) Report an error and exit with 1 if the specified session does not exist.  If it does exist, exit with 0.
kill-server Kill the tmux server and clients and destroy all sessions.
kill-session [-aC] [-t target-session] Destroy the given session, closing any windows linked to it and no other sessions, and detaching all clients attached to it.  If -a is given, all sessions but the specified one is killed.  The -C flag clears alerts (bell, activity, or silence) in all windows linked to the session.
list-clients [-F format] [-t target-session] (alias: lsc) List all clients attached to the server.  For the meaning of the -F flag, see the FORMATS section.  If target-session is specified, list only clients connected to that session.
list-commands [-F format] [command] (alias: lscm) List the syntax of command or - if omitted - of all commands supported by tmux.
list-sessions [-F format] [-f filter] (alias: ls) List all sessions managed by the server.  -F specifies the format of each line and -f a filter.  Only sessions for which the filter is true are shown.  See the FORMATS section.
lock-client [-t target-client] (alias: lockc) Lock target-client, see the lock-server command.
lock-session [-t target-session] (alias: locks) Lock all clients attached to target-session.
new-session [-AdDEPX] [-c start-directory] [-e environment] [-f flags] [-F format] [-n window-name] [-s session-name] [-t group-name] [-x width] [-y height] [shell-command] (alias: new) Create a new session with name session-name.
The new session is attached to the current terminal unless -d is given.  window-name and shell-command are the name of and shell command to execute in the initial window.  With -d, the initial size comes from the global default-size option; -x and -y can be used to specify a different size.  ‘-’ uses the size of the current client if any.  If -x or -y is given, the default-size option is set for the session.  -f sets a comma-separated list of client flags (see attach-session).
If run from a terminal, any termios(4) special characters are saved and used for new windows in the new session.
The -A flag makes new-session behave like attach-session if session-name already exists; in this case, -D behaves like -d to attach-session, and -X behaves like -x to attach-session.
If -t is given, it specifies a session group.  Sessions in the same group share the same set of windows - new windows are linked to all sessions in the group and any windows closed removed from all sessions.  The current and previous window and any session options remain independent and any session in a group may be killed without affecting the others.  The group-name argument may be:
1.      the name of an existing group, in which case the new session is added to that group;
2.      the name of an existing session - the new session is added to the same group as that session, creating a new group if necessary;
3.      the name for a new group containing only the new session.
-n and shell-command are invalid if -t is used.
The -P option prints information about the new session after it has been created.  By default, it uses the format ‘#{session_name}:’ but a different format may be specified with -F.
If -E is used, the update-environment option will not be applied. -e takes the form ‘VARIABLE=value’ and sets an environment variable for the newly created session; it may be specified multiple times.
refresh-client [-cDlLRSU] [-A pane:state] [-B name:what:format] [-C XxY] [-f flags] [-t target-client] [adjustment] (alias: refresh) Refresh the current client if bound to a key, or a single client if one is given with -t.  If -S is specified, only update the client's status line.
The -U, -D, -L -R, and -c flags allow the visible portion of a window which is larger than the client to be changed.  -U moves the visible part up by adjustment rows and -D down, -L left by adjustment columns and -R right.  -c returns to tracking the cursor automatically.  If adjustment is omitted, 1 is used.  Note that the visible position is a property of the client not of the window, changing the current window in the attached session will reset it.
-C sets the width and height of a control mode client.  -A allows a control mode client to trigger actions on a pane.  The argument is a pane ID (with leading ‘%’), a colon, then one of ‘on’, ‘off’, ‘continue’ or ‘pause’.  If ‘off’, tmux will not send output from the pane to the client and if all clients have turned the pane off, will stop reading from the pane.  If ‘continue’, tmux will return to sending output to the pane if it was paused (manually or with the pause-after flag).  If ‘pause’, tmux will pause the pane.  -A may be given multiple times for different panes.
-B sets a subscription to a format for a control mode client.  The argument is split into three items by colons: name is a name for the subscription; what is a type of item to subscribe to; format is the format.  After a subscription is added, changes to the format are reported with the %subscription-changed notification, at most once a second.  If only the name is given, the subscription is removed.  what may be empty to check the format only for the attached session, or one of: a pane ID such as ‘%0’; ‘%*’ for all panes in the attached session; a window ID such as ‘@0’; or ‘@*’ for all windows in the attached session.
-f sets a comma-separated list of client flags, see attach-session.
-l requests the clipboard from the client using the xterm(1) escape sequence and stores it in a new paste buffer.
-L, -R, -U and -D move the visible portion of the window left, right, up or down by adjustment, if the window is larger than the client.  -c resets so that the position follows the cursor.  See the window-size option.
rename-session [-t target-session] new-name (alias: rename) Rename the session to new-name.
show-messages [-JT] [-t target-client] (alias: showmsgs) Show server messages or information.  Messages are stored, up to a maximum of the limit set by the message-limit server option.  -J and -T show debugging information about jobs and terminals.
source-file [-Fnqv] path ... (alias: source) Execute commands from one or more files specified by path (which may be glob(7) patterns).  If -F is present, then path is expanded as a format.  If -q is given, no error will be returned if path does not exist.  With -n, the file is parsed but no commands are executed.  -v shows the parsed commands and line numbers if possible.
start-server (alias: start) Start the tmux server, if not already running, without creating any sessions.
Note that as by default the tmux server will exit with no sessions, this is only useful if a session is created in ~/.tmux.conf, exit-empty is turned off, or another command is run as part of the same command sequence.  For example:
$ tmux start \; show -g
suspend-client [-t target-client] (alias: suspendc) Suspend a client by sending SIGTSTP (tty stop).
switch-client [-ElnprZ] [-c target-client] [-t target-session] [-T key-table] (alias: switchc) Switch the current session for client target-client to target-session.  As a special case, -t may refer to a pane (a target that contains ‘:’, ‘.’ or ‘%’), to change session, window and pane.  In that case, -Z keeps the window zoomed if it was zoomed.  If -l, -n or -p is used, the client is moved to the last, next or previous session respectively.  -r toggles the client read-only and ignore-size flags (see the attach-session command).
If -E is used, update-environment option will not be applied.
-T sets the client's key table; the next key from the client will be interpreted from key-table.  This may be used to configure multiple prefix keys, or to bind commands to sequences of keys. For example, to make typing ‘abc’ run the list-keys command:
bind-key -Ttable2 c list-keys bind-key -Ttable1 b switch-client -Ttable2 bind-key -Troot   a switch-client -Ttable1
Each window displayed by tmux may be split into one or more panes; each pane takes up a certain area of the display and is a separate terminal.  A window may be split into panes using the split-window command.  Windows may be split horizontally (with the -h flag) or vertically.  Panes may be resized with the resize-pane command (bound to ‘C-Up’, ‘C-Down’ ‘C-Left’ and ‘C-Right’ by default), the current pane may be changed with the select-pane command and the rotate-window and swap-pane commands may be used to swap panes without changing their position.  Panes are numbered beginning from zero in the order they are created.
By default, a tmux pane permits direct access to the terminal contained in the pane.  A pane may also be put into one of several modes:
-   Copy mode, which permits a section of a window or its history to be copied to a paste buffer for later insertion into another window.  This mode is entered with the copy-mode command, bound to ‘[’ by default.  Copied text can be pasted with the paste-buffer command, bound to ‘]’.
-   View mode, which is like copy mode but is entered when a command that produces output, such as list-keys, is executed from a key binding.
-   Choose mode, which allows an item to be chosen from a list.  This may be a client, a session or window or pane, or a buffer.  This mode is entered with the choose-buffer, choose-client and choose-tree commands.
In copy mode an indicator is displayed in the top-right corner of the pane with the current position and the number of lines in the history.
Commands are sent to copy mode using the -X flag to the send-keys command. When a key is pressed, copy mode automatically uses one of two key tables, depending on the mode-keys option: copy-mode for emacs, or copy-mode-vi for vi.  Key tables may be viewed with the list-keys command.
The following commands are supported in copy mode:
The search commands come in several varieties: ‘search-forward’ and ‘search-backward’ search for a regular expression; the ‘-text’ variants search for a plain text string rather than a regular expression; ‘-incremental’ perform an incremental search and expect to be used with the -i flag to the command-prompt command.  ‘search-again’ repeats the last search and ‘search-reverse’ does the same but reverses the direction (forward becomes backward and backward becomes forward).
Copy commands may take an optional buffer prefix argument which is used to generate the buffer name (the default is ‘buffer’ so buffers are named ‘buffer0’, ‘buffer1’ and so on).  Pipe commands take a command argument which is the command to which the selected text is piped.  ‘copy-pipe’ variants also copy the selection.  The ‘-and-cancel’ variants of some commands exit copy mode after they have completed (for copy commands) or when the cursor reaches the bottom (for scrolling commands).  ‘-no-clear’ variants do not clear the selection.
The next and previous word keys use space and the ‘-’, ‘_’ and ‘@’ characters as word delimiters by default, but this can be adjusted by setting the word-separators session option.  Next word moves to the start of the next word, next word end to the end of the next word and previous word to the start of the previous word.  The three next and previous space keys work similarly but use a space alone as the word separator.
The jump commands enable quick movement within a line.  For instance, typing ‘f’ followed by ‘/’ will move the cursor to the next ‘/’ character on the current line.  A ‘;’ will then jump to the next occurrence.
Commands in copy mode may be prefaced by an optional repeat count.  With vi key bindings, a prefix is entered using the number keys; with emacs, the Alt (meta) key and a number begins prefix entry.
The synopsis for the copy-mode command is:
copy-mode [-eHMqu] [-s src-pane] [-t target-pane] Enter copy mode.  The -u option scrolls one page up.  -M begins a mouse drag (only valid if bound to a mouse key binding, see MOUSE SUPPORT).  -H hides the position indicator in the top right.  -q cancels copy mode and any other modes.  -s copies from src-pane instead of target-pane.
-e specifies that scrolling to the bottom of the history (to the visible screen) should exit copy mode.  While in copy mode, pressing a key other than those used for scrolling will disable this behaviour.  This is intended to allow fast scrolling through a pane's history, for example with:
bind PageUp copy-mode -eu
A number of preset arrangements of panes are available, these are called layouts.  These may be selected with the select-layout command or cycled with next-layout (bound to ‘Space’ by default); once a layout is chosen, panes within it may be moved and resized as normal.
The following layouts are supported:
even-horizontal Panes are spread out evenly from left to right across the window.
even-vertical Panes are spread evenly from top to bottom.
main-horizontal A large (main) pane is shown at the top of the window and the remaining panes are spread from left to right in the leftover space at the bottom.  Use the main-pane-height window option to specify the height of the top pane.
main-vertical Similar to main-horizontal but the large pane is placed on the left and the others spread from top to bottom along the right.  See the main-pane-width window option.
tiled   Panes are spread out as evenly as possible over the window in both rows and columns.
In addition, select-layout may be used to apply a previously used layout - the list-windows command displays the layout of each window in a form suitable for use with select-layout.  For example:
$ tmux list-windows 0: ksh [159x48] layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0} $ tmux select-layout bb62,159x48,0,0{79x48,0,0,79x48,80,0}
tmux automatically adjusts the size of the layout for the current window size.  Note that a layout cannot be applied to a window with more panes than that from which the layout was originally defined.
Commands related to windows and panes are as follows:
break-pane [-abdP] [-F format] [-n window-name] [-s src-pane] [-t dst-window] (alias: breakp) Break src-pane off from its containing window to make it the only pane in dst-window.  With -a or -b, the window is moved to the next index after or before (existing windows are moved if necessary). If -d is given, the new window does not become the current window. The -P option prints information about the new window after it has been created.  By default, it uses the format ‘#{session_name}:#{window_index}.#{pane_index}’ but a different format may be specified with -F.
capture-pane [-aepPqCJN] [-b buffer-name] [-E end-line] [-S start-line] [-t target-pane] (alias: capturep) Capture the contents of a pane.  If -p is given, the output goes to stdout, otherwise to the buffer specified with -b or a new buffer if omitted.  If -a is given, the alternate screen is used, and the history is not accessible.  If no alternate screen exists, an error will be returned unless -q is given.  If -e is given, the output includes escape sequences for text and background attributes.  -C also escapes non-printable characters as octal \xxx.  -N preserves trailing spaces at each line's end and -J preserves trailing spaces and joins any wrapped lines.  -P captures only any output that the pane has received that is the beginning of an as-yet incomplete escape sequence.
-S and -E specify the starting and ending line numbers, zero is the first line of the visible pane and negative numbers are lines in the history.  ‘-’ to -S is the start of the history and to -E the end of the visible pane.  The default is to capture only the visible contents of the pane.
choose-client [-NrZ] [-F format] [-f filter] [-K key-format] [-O sort-order] [-t target-pane] [template] Put a pane into client mode, allowing a client to be selected interactively from a list.  Each client is shown on one line.  A shortcut key is shown on the left in brackets allowing for immediate choice, or the list may be navigated and an item chosen or otherwise manipulated using the keys below.  -Z zooms the pane. The following keys may be used in client mode:
Key    Function Enter  Choose selected client Up     Select previous client Down   Select next client C-s    Search by name n      Repeat last search t      Toggle if client is tagged T      Tag no clients C-t    Tag all clients d      Detach selected client D      Detach tagged clients x      Detach and HUP selected client X      Detach and HUP tagged clients z      Suspend selected client Z      Suspend tagged clients f      Enter a format to filter items O      Change sort field r      Reverse sort order v      Toggle preview q      Exit mode
After a client is chosen, ‘%%’ is replaced by the client name in template and the result executed as a command.  If template is not given, "detach-client -t '%%'" is used.