|kitty| is capable of running multiple programs organized into tabs and windows. The top level of organization is the :term:`OS window <os_window>`. Each OS window consists of one or more :term:`tabs <tab>`. Each tab consists of one or more :term:`kitty windows <window>`. The kitty windows can be arranged in multiple different :term:`layouts <layout>`, like windows are organized in a tiling window manager. The keyboard controls (which are :ref:`all customizable <conf-kitty-shortcuts>`) for tabs and windows are:
The scroll actions only take effect when the terminal is in the main screen. When the alternate screen is active (for example when using a full screen program like an editor) the key events are instead passed to program running in the terminal.
| Action | Shortcut |
|---|---|
| New tab | :sc:`new_tab` (also ⌘+t on macOS) |
| Close tab | :sc:`close_tab` (also ⌘+w on macOS) |
| Next tab | :sc:`next_tab` (also ⌃+⇥ and ⇧+⌘+] on macOS) |
| Previous tab | :sc:`previous_tab` (also ⇧+⌃+⇥ and ⇧+⌘+[ on macOS) |
| Next layout | :sc:`next_layout` |
| Move tab forward | :sc:`move_tab_forward` |
| Move tab backward | :sc:`move_tab_backward` |
| Set tab title | :sc:`set_tab_title` (also ⇧+⌘+i on macOS) |
| Action | Shortcut |
|---|---|
| New window | :sc:`new_window` (also ⌘+↩ on macOS) |
| New OS window | :sc:`new_os_window` (also ⌘+n on macOS) |
| Close window | :sc:`close_window` (also ⇧+⌘+d on macOS) |
| Resize window | :sc:`start_resizing_window` (also ⌘+r on macOS) |
| Next window | :sc:`next_window` |
| Previous window | :sc:`previous_window` |
| Move window forward | :sc:`move_window_forward` |
| Move window backward | :sc:`move_window_backward` |
| Move window to top | :sc:`move_window_to_top` |
| Visually focus window | :sc:`focus_visible_window` |
| Visually swap window | :sc:`swap_with_window` |
| Focus specific window | :sc:`first_window`, :sc:`second_window` ... :sc:`tenth_window` (also ⌘+1, ⌘+2 ... ⌘+9 on macOS) (clockwise from the top-left) |
Additionally, you can define shortcuts in :file:`kitty.conf` to focus neighboring windows and move windows around (similar to window movement in :program:`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 # moves the window into a new tab created to the left of the active tab map ctrl+f3 detach_window new-tab-left # asks which tab to move the window into map ctrl+f4 detach_window ask
The detach_window action also accepts the options of :program:`kitten @ detach-window`, which can be combined with :option:`launch --focus-existing` to use tabs like named workspaces, switching to a tab, or sending the current window to it, creating the tab if it does not exist:
# switch to the tab named 1, creating it if needed map ctrl+1 launch --type=tab --tab-title=1 --location=by-title --focus-existing=@title # move the current window to the tab named 1, creating it if needed map ctrl+shift+1 detach_window --target-tab=@title --tab-title=1 --location=by-title --create-if-missing
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
Note that tabs can be re-arranged, detached and moved to another OS Window in the same kitty instance using drag and drop.
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
The full list of actions that can be mapped to key presses is available :doc:`here </actions>`. To learn how to do more sophisticated keyboard mappings, such as modal mappings, per application mappings, etc. see :doc:`mapping`.
