kitty

提供: ArchWiki
2022年10月17日 (月) 17:52時点におけるKusanaginoturugi (トーク | 投稿記録)による版 (→‎Kitten: 英語版を元に変更)
ナビゲーションに移動 検索に移動

Kitty はスクリプトを組める OpenGL ベースのターミナルエミュレータです。タイル機能、TrueColor、合字、キーボード入力と画像レンダリングのプロトコル拡張があります。また、 GNU Screentmux のようなタイリング機能も提供します。

インストール

kitty パッケージ、または開発版のkitty-gitAURインストールしてください。

使用方法

新しいタブやウィンドウを ctrl+shift ショートカットで作成・リサイズすることができます。レイアウトは ctrl+shift+l で切り替えて保存・復元することが可能です。

フルキーボードモードでは ctrl+itab などのキーを区別します。さらに、アプリケーションによっては波線などのエフェクトを使うことができます。

Kitten

Kitty には kittens と呼ばれるサブプログラムを作成するためのフレームワークがあります。すべての kitten のコマンドは kitty +kitten というプレフィックスを持つので、シェルのエイリアスとして使用すると便利です。

icat

This kitten is based on the kitty graphics protocol. It needs ImageMagick to be installed. To show an image in the terminal:

$ kitty +kitten icat image.jpg

It can also display animated gifs in the terminal. Instead of an image file, you can pass a directory or an image url. This also works over ssh to display images from a remote server. Several applications such as ranger and neofetch use this protocol for displaying images in the terminal. For more information, see the official documentation

diff

This kitten requires either git or diffutils to be installed. Optionally, install python-pygments for syntax highlighting. To show a diff of two files:

$ kitty +kitten diff file1 file2

It displays diffs for images as well as text files. This kitten can also be used over ssh. You can pass directories instead of files for a recursive diff. For more information, see the official documentation.

clipboard

This kitten is used to read and write to the system clipboard and can be used to work with a clipboard even over ssh. To copy stdin to the system clipboard:

$ echo "Hello" | kitty +kitten clipboard

To output the current clipboard contents to stdout:

$ kitty +kitten clipboard --get-clipboard

This command will show a permission popup by default. To disable this, edit the clipboard_control option in the configuration file:

~/.config/kitty/kitty.conf
clipboard_control write-clipboard read-clipboard

For more information, see the official documentation.

設定

kitty は ~/.config/kitty/kitty.conf に設定を保存し、デフォルトの設定は /usr/share/doc/kitty/kitty.conf で確認できます。フォント・カラー・カーソル・スクロールバックバッファの動作を調整することができます。利用可能なすべてのオプションは、公式ドキュメントまたは kitty.conf(5) で確認することができます。

ノート: vim でデフォルト設定を編集している場合、セクションは折り畳まれ始めます。各セクションは、通常モードで zo を使用して拡張できます。
ヒント:
  • /usr/share/doc/kitty/kitty.conf にあるデフォルトの設定ファイルは、各オプションを説明するコメント付きの自己文書化されています。
  • 公式ドキュメントは、/usr/share/doc/kitty/html/index.html でローカルに入手できます。

ヒントとテクニック

IME サポートを有効にする

IBus IME フレームワークの Kitty サポートは、既定で無効になっています。これを有効にするには、環境変数 GLFW_IM_MODULE=ibus を設定します。互換性のある IBus インターフェースが提供されているので、 Fcitx5 でも動作します。

シングルインスタンスモード

これはデーモンモードと似たような働きをします。kitty を -single-instance または -1 オプションで起動すると、kitty のインスタンスは 1 つだけ実行されます。続けて同じオプションで kitty を起動すると、既存の kitty インスタンスの新しいウィンドウが作成されます。これにより、GPU キャッシュが共有されるためメモリ使用量が少なくなり、起動時間も短縮されます。kitty のインスタンスは --instance group name オプションで複数のグループを持つことができます。詳しくは kitty(1) § single-instance を参照してください。

トラブルシューティング

SSH のターミナルの問題

kitty を使用して、terminfo を持たないリモートに ssh 接続すると、さまざまな問題が発生する可能性があります。解決策は通常 terminfo にコピーすることです。kitty には、まさにこれを自動化するための ssh kitten があります。

kitty +kitten ssh user@host

ssh のエイリアスとして設定したい場合、そのための一つの方法として、ユーザーが Kitty を使っているかどうかを検出し、もしそうなら、ssh コマンドのエイリアスを設定することです。これを行うには(Bashで)~/.bashrcファイルに次の行を追加します。

~/.bashrc
[[ "$TERM" == "xterm-kitty" ]] && alias ssh="kitty +kitten ssh"

何らかの理由でリモートに terminfo をインストールできない場合、 TERM をより存在しやすいものに設定してみてください。この場合、端末の機能のいくつかが使えなくなる可能性があることに注意してください。OpenSSH#適切な terminfo エントリがないリモートに接続する場合 を参照してください。

vim で背景色が消える

vim で背景色のある配色を使用すると、スクロール中に背景が消えたりちらついたりすることがあります。これを修正するには、環境変数 TERM がまだ xterm-kitty に設定されていることを確認してから、次の行を .vimrc ファイルに追加します。

関連するバグ報告: Github issue #108, kitty FAQ

参照

翻訳ステータス: このページは en:Kitty の翻訳バージョンです。最後の翻訳日は 2022-08-25 です。もし英語版に 変更 があれば、翻訳の同期を手伝うことができます。