The kitty command line interface#
kitty [options] [program-to-run ...]
Run the kitty terminal emulator. You can also specify the program to run inside kitty as normal arguments following the options. For example: kitty sh -c “echo hello, world. Press ENTER to quit; read”
For comprehensive documentation for kitty, please see: https://sw.kovidgoyal.net/kitty/
Options#
- --class <CLS>#
Set the class part of the WM_CLASS window property. On Wayland, it sets the app id. Default:
kitty
- --name <NAME>#
Set the name part of the WM_CLASS property (defaults to using the value from
kitty --class
)
- --title <TITLE>, -T <TITLE>#
Set the OS window title. This will override any title set by the program running inside kitty, permanently fixing the OS Window’s title. So only use this if you are running a program that does not set titles.
- --config <CONFIG>, -c <CONFIG>#
Specify a path to the configuration file(s) to use. All configuration files are merged onto the builtin kitty.conf, overriding the builtin values. This option can be specified multiple times to read multiple configuration files in sequence, which are merged. Use the special value NONE to not load a config file.
If this option is not specified, config files are searched for in the order:
$XDG_CONFIG_HOME/kitty/kitty.conf
,~/.config/kitty/kitty.conf
,$XDG_CONFIG_DIRS/kitty/kitty.conf
. The first one that exists is used as the config file.If the environment variable
KITTY_CONFIG_DIRECTORY
is specified, that directory is always used and the above searching does not happen.If
/etc/xdg/kitty/kitty.conf
exists it is merged before (i.e. with lower priority) than any user config files. It can be used to specify system-wide defaults for all users. You can use either-
or/dev/stdin
to read the config from STDIN.
- --override <OVERRIDE>, -o <OVERRIDE>#
Override individual configuration options, can be specified multiple times. Syntax: name=value. For example:
kitty -o
font_size=20
- --directory <DIRECTORY>, --working-directory <DIRECTORY>, -d <DIRECTORY>#
Change to the specified directory when launching Default:
.
- --detach#
Detach from the controlling terminal, if any
- --session <SESSION>#
Path to a file containing the startup session (tabs, windows, layout, programs). Use - to read from STDIN. See the README file for details and an example.
- --hold#
Remain open after child process exits. Note that this only affects the first window. You can quit by either using the close window shortcut or pressing any key.
- --single-instance, -1#
If specified only a single instance of kitty will run. New invocations will instead create a new top-level window in the existing kitty instance. This allows kitty to share a single sprite cache on the GPU and also reduces startup time. You can also have separate groups of kitty instances by using the
kitty --instance-group
option
- --instance-group <INSTANCE_GROUP>#
Used in combination with the
kitty --single-instance
option. All kitty invocations with the samekitty --instance-group
will result in new windows being created in the first kitty instance within that group
- --wait-for-single-instance-window-close#
Normally, when using
--single-instance
, kitty will open a new window in an existing instance and quit immediately. With this option, it will not quit till the newly opened window is closed. Note that if no previous instance is found, then kitty will wait anyway, regardless of this option.
- --listen-on <LISTEN_ON>#
Tell kitty to listen on the specified address for control messages. For example,
kitty --listen-on
=unix:/tmp/mykitty
orkitty --listen-on
=tcp:localhost:12345
. On Linux systems, you can also use abstract UNIX sockets, not associated with a file, like this:kitty --listen-on
=unix:@mykitty
. Environment variables in the setting are expanded and relative paths are resolved with respect to the temporary directory. To control kitty, you can send it commands with kitty @ using thekitty @ --to
option to specify this address. This option will be ignored, unless you setallow_remote_control
to yes inkitty.conf
. Note that if you run kitty @ within a kitty window, there is no need to specify thekitty @ --to
option as it is read automatically from the environment. For UNIX sockets, this can also be specified inkitty.conf
.
- --start-as <START_AS>#
Control how the initial kitty window is created. Default:
normal
Choices:fullscreen
,maximized
,minimized
,normal
Debugging options#
- --version, -v#
The current kitty version
- --dump-commands#
Output commands received from child process to stdout
- --replay-commands <REPLAY_COMMANDS>#
Replay previously dumped commands. Specify the path to a dump file previously created by
kitty --dump-commands
. You can open a new kitty window to replay the commands with:kitty sh -c "kitty --replay-commands /path/to/dump/file; read"
- --dump-bytes <DUMP_BYTES>#
Path to file in which to store the raw bytes received from the child process
- --debug-gl, --debug-rendering#
Debug rendering commands. This will cause all OpenGL calls to check for errors instead of ignoring them. Also prints out miscellaneous debug information. Useful when debugging rendering problems
- --debug-input, --debug-keyboard#
This option will cause kitty to print out key and mouse events as they are received
- --debug-font-fallback#
Print out information about the selection of fallback fonts for characters not present in the main font.
Tabs and Windows#
kitty is capable of running multiple programs organized into tabs and windows. The top level of organization is the Tab. Each tab consists of one or more windows. The windows can be arranged in multiple different layouts, like windows are organized in a tiling window manager. The keyboard controls (which are all customizable) for tabs and windows are:
Scrolling#
Action |
Shortcut |
---|---|
Line up |
|
Line down |
|
Page up |
|
Page down |
|
Top |
|
Bottom |
|
Previous shell prompt |
|
Next shell prompt |
|
Browse scrollback in less |
|
Browse last cmd output |
Tabs#
Action |
Shortcut |
---|---|
New tab |
|
Close tab |
|
Next tab |
|
Previous tab |
|
Next layout |
|
Move tab forward |
|
Move tab backward |
|
Set tab title |
|
Windows#
Action |
Shortcut |
---|---|
New window |
|
New OS window |
|
Close window |
|
Next window |
|
Previous window |
|
Move window forward |
|
Move window backward |
|
Move window to top |
|
Visually focus window |
|
Visually swap window |
|
Focus specific window |
|
Additionally, you can define shortcuts in kitty.conf
to focus neighboring
windows and move windows around (similar to window movement in vim):
map ctrl+left neighboring_window left
map shift+left move_window right
map ctrl+down neighboring_window down
map shift+down move_window up
...
You can also define a shortcut to switch to the previously active window:
map ctrl+p nth_window -1
nth_window
will focus the nth window for positive numbers (starting from
zero) and the previously active windows for negative numbers.
To switch to the nth OS window, you can define nth_os_window
. Only positive
numbers are accepted, starting from one.
You can define shortcuts to detach the current window and move it to another tab or another OS window:
# moves the window into a new OS window
map ctrl+f2 detach_window
# moves the window into a new Tab
map ctrl+f3 detach_window new-tab
# moves the window into the previously active tab
map ctrl+f3 detach_window tab-prev
# moves the window into the tab at the left of the active tab
map ctrl+f3 detach_window tab-left
# asks which tab to move the window into
map ctrl+f4 detach_window ask
Similarly, you can detach the current tab, with:
# moves the tab into a new OS window
map ctrl+f2 detach_tab
# asks which OS Window to move the tab into
map ctrl+f4 detach_tab ask
Finally, you can define a shortcut to close all windows in a tab other than the currently active window:
map f9 close_other_windows_in_tab
Other keyboard shortcuts#
The full list of actions that can be mapped to key presses is available here.
Action |
Shortcut |
---|---|
Copy to clipboard |
|
Paste from clipboard |
|
Paste from selection |
|
Increase font size |
|
Decrease font size |
|
Restore font size |
|
Toggle fullscreen |
|
Toggle maximized |
|
Input unicode character |
|
Open URL in web browser |
|
Reset the terminal |
|
Reload |
|
Debug |
|
Pass current selection to program |
|
Edit kitty config file |
|
Open a kitty shell |
|
Increase background opacity |
|
Decrease background opacity |
|
Full background opacity |
|
Reset background opacity |
See also#
See kitty.conf(5)