2021-07-17 13:58:42 +03:00
|
|
|
Overview
|
|
|
|
==============
|
|
|
|
|
|
|
|
Design philosophy
|
|
|
|
-------------------
|
|
|
|
|
2022-04-30 11:55:04 +03:00
|
|
|
|kitty| is designed for power keyboard users. To that end all its controls work
|
|
|
|
with the keyboard (although it fully supports mouse interactions as well). Its
|
|
|
|
configuration is a simple, human editable, single file for easy reproducibility
|
|
|
|
(I like to store configuration in source control).
|
2021-07-17 13:58:42 +03:00
|
|
|
|
|
|
|
The code in |kitty| is designed to be simple, modular and hackable. It is
|
2023-02-10 08:21:16 +03:00
|
|
|
written in a mix of C (for performance sensitive parts), Python (for easy
|
|
|
|
extensibility and flexibility of the UI) and Go (for the command line
|
|
|
|
:term:`kittens`). It does not depend on any large and complex UI toolkit,
|
2022-04-30 11:55:04 +03:00
|
|
|
using only OpenGL for rendering everything.
|
|
|
|
|
|
|
|
Finally, |kitty| is designed from the ground up to support all modern terminal
|
|
|
|
features, such as Unicode, true color, bold/italic fonts, text formatting, etc.
|
|
|
|
It even extends existing text formatting escape codes, to add support for
|
|
|
|
features not available elsewhere, such as colored and styled (curly) underlines.
|
|
|
|
One of the design goals of |kitty| is to be easily extensible so that new
|
|
|
|
features can be added in the future with relatively little effort.
|
2021-07-17 13:58:42 +03:00
|
|
|
|
|
|
|
.. include:: basic.rst
|
|
|
|
|
|
|
|
|
|
|
|
Configuring kitty
|
|
|
|
-------------------
|
|
|
|
|
2022-04-30 11:55:04 +03:00
|
|
|
|kitty| is highly configurable, everything from keyboard shortcuts to painting
|
|
|
|
frames-per-second. Press :sc:`edit_config_file` in kitty to open its fully
|
|
|
|
commented sample config file in your text editor. For details see the
|
|
|
|
:doc:`configuration docs <conf>`.
|
2021-07-17 13:58:42 +03:00
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
|
|
|
|
conf
|
|
|
|
|
|
|
|
|
|
|
|
.. _layouts:
|
|
|
|
|
|
|
|
Layouts
|
|
|
|
----------
|
|
|
|
|
|
|
|
A :term:`layout` is an arrangement of multiple :term:`kitty windows <window>`
|
|
|
|
inside a top-level :term:`OS window <os_window>`. The layout manages all its
|
|
|
|
windows automatically, resizing and moving them as needed. You can create a new
|
|
|
|
:term:`window` using the :sc:`new_window` key combination.
|
|
|
|
|
|
|
|
Currently, there are seven layouts available:
|
|
|
|
|
2022-04-30 11:55:04 +03:00
|
|
|
* **Fat** -- One (or optionally more) windows are shown full width on the top,
|
|
|
|
the rest of the windows are shown side-by-side on the bottom
|
|
|
|
|
2021-07-17 13:58:42 +03:00
|
|
|
* **Grid** -- All windows are shown in a grid
|
2022-04-30 11:55:04 +03:00
|
|
|
|
2021-07-17 13:58:42 +03:00
|
|
|
* **Horizontal** -- All windows are shown side-by-side
|
2022-04-30 11:55:04 +03:00
|
|
|
|
|
|
|
* **Splits** -- Windows arranged in arbitrary patterns created using horizontal
|
|
|
|
and vertical splits
|
|
|
|
|
2021-07-17 13:58:42 +03:00
|
|
|
* **Stack** -- Only a single maximized window is shown at a time
|
2022-04-30 11:55:04 +03:00
|
|
|
|
|
|
|
* **Tall** -- One (or optionally more) windows are shown full height on the
|
|
|
|
left, the rest of the windows are shown one below the other on the right
|
|
|
|
|
2021-07-17 13:58:42 +03:00
|
|
|
* **Vertical** -- All windows are shown one below the other
|
|
|
|
|
|
|
|
By default, all layouts are enabled and you can switch between layouts using
|
|
|
|
the :sc:`next_layout` key combination. You can also create shortcuts to select
|
2022-04-30 11:55:04 +03:00
|
|
|
particular layouts, and choose which layouts you want to enable, see
|
2021-07-17 13:58:42 +03:00
|
|
|
:ref:`conf-kitty-shortcuts.layout` for examples. The first layout listed in
|
|
|
|
:opt:`enabled_layouts` becomes the default layout.
|
|
|
|
|
|
|
|
For more details on the layouts and how to use them see :doc:`the documentation
|
|
|
|
<layouts>`.
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
|
|
|
|
layouts
|
|
|
|
|
|
|
|
Extending kitty
|
|
|
|
------------------
|
|
|
|
|
|
|
|
kitty has a powerful framework for scripting. You can create small terminal
|
2022-12-16 07:06:25 +03:00
|
|
|
programs called :doc:`kittens <kittens_intro>`. These can be used to add features
|
2021-07-17 13:58:42 +03:00
|
|
|
to kitty, for example, :doc:`editing remote files <kittens/remote_file>` or
|
2022-04-30 11:55:04 +03:00
|
|
|
:doc:`inputting Unicode characters <kittens/unicode_input>`. They can also be
|
2021-07-17 13:58:42 +03:00
|
|
|
used to create programs that leverage kitty's powerful features, for example,
|
2022-04-30 11:55:04 +03:00
|
|
|
:doc:`viewing images <kittens/icat>` or :doc:`diffing files with image support
|
2021-07-17 13:58:42 +03:00
|
|
|
<kittens/diff>`.
|
|
|
|
|
|
|
|
You can :doc:`create your own kittens to scratch your own itches
|
|
|
|
<kittens/custom>`.
|
|
|
|
|
|
|
|
For a list of all the builtin kittens, :ref:`see here <kittens>`.
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
|
|
|
|
kittens_intro
|
|
|
|
|
|
|
|
|
|
|
|
Remote control
|
|
|
|
------------------
|
|
|
|
|
|
|
|
|kitty| has a very powerful system that allows you to control it from the
|
|
|
|
:doc:`shell prompt, even over SSH <remote-control>`. You can change colors,
|
|
|
|
fonts, open new :term:`windows <window>`, :term:`tabs <tab>`, set their titles,
|
2022-04-30 11:55:04 +03:00
|
|
|
change window layout, get text from one window and send text to another, etc.
|
|
|
|
The possibilities are endless. See the :doc:`tutorial <remote-control>` to get
|
|
|
|
started.
|
2021-07-17 13:58:42 +03:00
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
|
|
|
|
remote-control
|
|
|
|
|
|
|
|
|
|
|
|
.. _sessions:
|
|
|
|
|
|
|
|
Startup Sessions
|
|
|
|
------------------
|
|
|
|
|
2021-08-03 10:28:38 +03:00
|
|
|
You can control the :term:`tabs <tab>`, :term:`kitty window <window>` layout,
|
2022-04-30 11:55:04 +03:00
|
|
|
working directory, startup programs, etc. by creating a *session* file and using
|
|
|
|
the :option:`kitty --session` command line flag or the :opt:`startup_session`
|
2023-01-06 19:36:58 +03:00
|
|
|
option in :file:`kitty.conf`. An example, showing all available commands:
|
2021-07-17 13:58:42 +03:00
|
|
|
|
|
|
|
.. code-block:: session
|
|
|
|
|
|
|
|
# Set the layout for the current tab
|
|
|
|
layout tall
|
|
|
|
# Set the working directory for windows in the current tab
|
|
|
|
cd ~
|
|
|
|
# Create a window and run the specified command in it
|
|
|
|
launch zsh
|
2022-04-30 11:55:04 +03:00
|
|
|
# Create a window with some environment variables set and run vim in it
|
2021-07-17 13:58:42 +03:00
|
|
|
launch --env FOO=BAR vim
|
|
|
|
# Set the title for the next window
|
|
|
|
launch --title "Chat with x" irssi --profile x
|
|
|
|
|
2022-04-30 11:55:04 +03:00
|
|
|
# Create a new tab
|
|
|
|
# The part after new_tab is the optional tab title which will be displayed in
|
|
|
|
# the tab bar, if omitted, the title of the active window will be used instead.
|
2021-07-17 13:58:42 +03:00
|
|
|
new_tab my tab
|
|
|
|
cd ~/somewhere
|
|
|
|
# Set the layouts allowed in this tab
|
2022-04-30 11:55:04 +03:00
|
|
|
enabled_layouts tall,stack
|
2021-07-17 13:58:42 +03:00
|
|
|
# Set the current layout
|
|
|
|
layout stack
|
|
|
|
launch zsh
|
|
|
|
|
|
|
|
# Create a new OS window
|
2023-01-17 06:05:46 +03:00
|
|
|
# Any definitions specified before the first new_os_window will apply to first OS window.
|
2021-07-17 13:58:42 +03:00
|
|
|
new_os_window
|
2022-04-30 11:55:04 +03:00
|
|
|
# Set new window size to 80x24 cells
|
|
|
|
os_window_size 80c 24c
|
|
|
|
# Set the --class for the new OS window
|
2021-07-17 13:58:42 +03:00
|
|
|
os_window_class mywindow
|
|
|
|
launch sh
|
2022-06-14 17:29:01 +03:00
|
|
|
# Resize the current window (see the resize_window action for details)
|
|
|
|
resize_window wider 2
|
2022-09-10 05:57:36 +03:00
|
|
|
# Make the current window the active (focused) window in its tab
|
2021-07-17 13:58:42 +03:00
|
|
|
focus
|
2022-09-10 05:57:36 +03:00
|
|
|
# Make the current OS Window the globally active window (not supported on Wayland)
|
|
|
|
focus_os_window
|
2021-07-17 13:58:42 +03:00
|
|
|
launch emacs
|
|
|
|
|
|
|
|
.. note::
|
2022-04-30 11:55:04 +03:00
|
|
|
The :doc:`launch <launch>` command when used in a session file cannot create
|
|
|
|
new OS windows, or tabs.
|
2021-07-17 13:58:42 +03:00
|
|
|
|
2023-01-23 15:04:53 +03:00
|
|
|
.. note::
|
|
|
|
Environment variables of the for :code:`${NAME}` or :code:`$NAME` are
|
|
|
|
expanded in the session file, except in the *arguments* (not options) to the
|
|
|
|
launch command.
|
|
|
|
|
2021-07-17 13:58:42 +03:00
|
|
|
|
2021-07-21 08:05:58 +03:00
|
|
|
Creating tabs/windows
|
2021-07-17 13:58:42 +03:00
|
|
|
-------------------------------
|
|
|
|
|
|
|
|
kitty can be told to run arbitrary programs in new :term:`tabs <tab>`,
|
|
|
|
:term:`windows <window>` or :term:`overlays <overlay>` at a keypress.
|
|
|
|
To learn how to do this, see :doc:`here <launch>`.
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
|
|
|
|
launch
|
|
|
|
|
|
|
|
|
|
|
|
Mouse features
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
* You can click on a URL to open it in a browser.
|
|
|
|
* You can double click to select a word and then drag to select more words.
|
|
|
|
* You can triple click to select a line and then drag to select more lines.
|
2022-04-30 11:55:04 +03:00
|
|
|
* You can triple click while holding :kbd:`Ctrl+Alt` to select from clicked
|
2021-07-17 13:58:42 +03:00
|
|
|
point to end of line.
|
|
|
|
* You can right click to extend a previous selection.
|
2022-04-30 11:55:04 +03:00
|
|
|
* You can hold down :kbd:`Ctrl+Alt` and drag with the mouse to select in
|
2021-07-17 13:58:42 +03:00
|
|
|
columns.
|
2022-04-30 11:55:04 +03:00
|
|
|
* Selecting text automatically copies it to the primary clipboard (on platforms
|
2021-07-17 13:58:42 +03:00
|
|
|
with a primary clipboard).
|
2022-04-30 11:55:04 +03:00
|
|
|
* You can middle click to paste from the primary clipboard (on platforms with a
|
|
|
|
primary clipboard).
|
|
|
|
* You can right click while holding :kbd:`Ctrl+Shift` to open the output of the
|
|
|
|
clicked on command in a pager (requires :ref:`shell_integration`)
|
|
|
|
* You can select text with kitty even when a terminal program has grabbed the
|
|
|
|
mouse by holding down the :kbd:`Shift` key
|
2021-07-17 13:58:42 +03:00
|
|
|
|
|
|
|
All these actions can be customized in :file:`kitty.conf` as described
|
|
|
|
:ref:`here <conf-kitty-mouse.mousemap>`.
|
|
|
|
|
2022-04-30 11:55:04 +03:00
|
|
|
You can also customize what happens when clicking on :term:`hyperlinks` in
|
|
|
|
kitty, having it open files in your editor, download remote files, open things
|
2021-07-17 13:58:42 +03:00
|
|
|
in your browser, etc.
|
|
|
|
|
|
|
|
For details, see :doc:`here <open_actions>`.
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
|
|
|
|
open_actions
|
|
|
|
|
|
|
|
Font control
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
|kitty| has extremely flexible and powerful font selection features. You can
|
2022-04-30 11:55:04 +03:00
|
|
|
specify individual families for the regular, bold, italic and bold+italic fonts.
|
|
|
|
You can even specify specific font families for specific ranges of Unicode
|
|
|
|
characters. This allows precise control over text rendering. It can comein handy
|
|
|
|
for applications like powerline, without the need to use patched fonts. See the
|
|
|
|
various font related configuration directives in :ref:`conf-kitty-fonts`.
|
2021-07-17 13:58:42 +03:00
|
|
|
|
|
|
|
|
|
|
|
.. _scrollback:
|
|
|
|
|
|
|
|
The scrollback buffer
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
|kitty| supports scrolling back to view history, just like most terminals. You
|
2022-04-30 11:55:04 +03:00
|
|
|
can use either keyboard shortcuts or the mouse scroll wheel to do so. However,
|
|
|
|
|kitty| has an extra, neat feature. Sometimes you need to explore the scrollback
|
|
|
|
buffer in more detail, maybe search for some text or refer to it side-by-side
|
|
|
|
while typing in a follow-up command. |kitty| allows you to do this by pressing
|
|
|
|
the :sc:`show_scrollback` shortcut, which will open the scrollback buffer in
|
|
|
|
your favorite pager program (which is :program:`less` by default). Colors and
|
|
|
|
text formatting are preserved. You can explore the scrollback buffer comfortably
|
|
|
|
within the pager.
|
2021-07-17 13:58:42 +03:00
|
|
|
|
|
|
|
Additionally, you can pipe the contents of the scrollback buffer to an
|
2022-04-30 11:55:04 +03:00
|
|
|
arbitrary, command running in a new :term:`window`, :term:`tab` or
|
|
|
|
:term:`overlay`. For example::
|
2021-07-17 13:58:42 +03:00
|
|
|
|
|
|
|
map f1 launch --stdin-source=@screen_scrollback --stdin-add-formatting less +G -R
|
|
|
|
|
2022-04-30 11:55:04 +03:00
|
|
|
Would open the scrollback buffer in a new :term:`window` when you press the
|
|
|
|
:kbd:`F1` key. See :sc:`show_scrollback <show_scrollback>` for details.
|
2021-07-17 13:58:42 +03:00
|
|
|
|
2022-04-30 11:55:04 +03:00
|
|
|
If you want to use it with an editor such as :program:`vim` to get more powerful
|
|
|
|
features, you can see tips for doing so, in :iss:`this thread <719>`.
|
2021-07-17 13:58:42 +03:00
|
|
|
|
2022-04-30 11:55:04 +03:00
|
|
|
If you wish to store very large amounts of scrollback to view using the piping
|
|
|
|
or :sc:`show_scrollback <show_scrollback>` features, you can use the
|
2021-12-10 09:36:16 +03:00
|
|
|
:opt:`scrollback_pager_history_size` option.
|
2021-07-17 13:58:42 +03:00
|
|
|
|
2021-07-15 07:58:02 +03:00
|
|
|
|
2021-07-21 12:17:54 +03:00
|
|
|
Integration with shells
|
2021-07-15 07:58:02 +03:00
|
|
|
---------------------------------
|
|
|
|
|
|
|
|
kitty has the ability to integrate closely within common shells, such as `zsh
|
2022-04-30 11:55:04 +03:00
|
|
|
<https://www.zsh.org/>`__, `fish <https://fishshell.com>`__ and `bash
|
|
|
|
<https://www.gnu.org/software/bash/>`__ to enable features such as jumping to
|
2021-07-20 07:38:33 +03:00
|
|
|
previous prompts in the scrollback, viewing the output of the last command in
|
|
|
|
:program:`less`, using the mouse to move the cursor while editing prompts, etc.
|
|
|
|
See :doc:`shell-integration` for details.
|
2021-07-15 07:58:02 +03:00
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
|
|
|
|
shell-integration
|
|
|
|
|
2021-07-17 13:58:42 +03:00
|
|
|
.. _cpbuf:
|
|
|
|
|
|
|
|
Multiple copy/paste buffers
|
|
|
|
-----------------------------
|
|
|
|
|
2022-04-30 11:55:04 +03:00
|
|
|
In addition to being able to copy/paste from the system clipboard, in |kitty|
|
|
|
|
you can also setup an arbitrary number of copy paste buffers. To do so, simply
|
|
|
|
add something like the following to your :file:`kitty.conf`::
|
2021-07-17 13:58:42 +03:00
|
|
|
|
|
|
|
map f1 copy_to_buffer a
|
|
|
|
map f2 paste_from_buffer a
|
|
|
|
|
|
|
|
This will allow you to press :kbd:`F1` to copy the current selection to an
|
|
|
|
internal buffer named ``a`` and :kbd:`F2` to paste from that buffer. The buffer
|
2022-04-30 11:55:04 +03:00
|
|
|
names are arbitrary strings, so you can define as many such buffers as you need.
|
2021-07-17 13:58:42 +03:00
|
|
|
|
|
|
|
|
|
|
|
Marks
|
|
|
|
-------------
|
|
|
|
|
|
|
|
kitty has the ability to mark text on the screen based on regular expressions.
|
|
|
|
This can be useful to highlight words or phrases when browsing output from long
|
|
|
|
running programs or similar. To learn how this feature works, see :doc:`marks`.
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:hidden:
|
|
|
|
|
|
|
|
marks
|