Ghostty の設定 : hkob の雑記録 (277)

はじめに

hkob の雑記録の第277回目は、iterm2 の代わりに Ghostty をインストールした記録を残しておきます。

Ghostty のインストール

Ghostty については、ゼミナールの学生が教えてくれました。config がテキストで設定できること、GPU のアクセラレーションが効くこと、あまり設定をしなくてもいい感じで使い始められるとのことでした。最近話題のようで、Mac にインストールしている人が多いようです。

qiita.com

www.pnkts.net

zenn.dev

オリジナルのサイトはこちらになります。

ghostty.org

インストール

私は Homebrew でインストールしました。Brewfile に以下を記載しました。

cask "ghostty" # Terminal emulator that uses platform-native UI and GPU acceleration

インストールしました。このようなアイコンです。

Ghostty のアイコン

起動しました。非常に簡素な表示です。

Ghostty 画面

左上にフォルダが見えるので、他のものと同じように Cmd クリックしたところフォルダ階層が表示されました。開くだけであれば、ターミナルで open . とした方が早いですが。

フォルダを Cmd + click

設定ファイルの移動

設定ファイルについては、個々の Mac で共有したいので、Mackup で管理できるかを確認します。 .config/ghostty/config を共有できるようです。

> mackup show ghostty
Name: Ghostty
Configuration files:
 - .config/ghostty/config

設定ファイルは Ghostty で Settings… とすると作成されるようです。

メニュー から Settings...

設定ファイル config はテキストエディトで開かれました。

config

このファイルは ~/Library/Application Support/com.mitchellh.ghostty/config に設置されているようです。

config の場所 (デフォルト)

この件について Ghostty のドキュメントを確認してみました。

ghostty.org

以下のように記載されています。macOS の場合には、上に記載したように Library の下に作成されてしまうようです。ただし、 .config/ghostty にファイルがあれば、そちらを先に見てくれるようです。

File Location

The configuration file, config, is loaded from these locations in the following order:

XDG configuration Path (all platforms):

  • $XDG_CONFIG_HOME/ghostty/config.
  • if XDG_CONFIG_HOME is not defined, it defaults to $HOME/.config/ghostty/config.

macOS-specific Path (macOS only):

  • $HOME/Library/Application\ Support/com.mitchellh.ghostty/config.
  • macOS also supports the XDG configuration path mentioned above.

If both locations exist, they are loaded in the order above with conflicting values in later files overriding earlier ones. Configuration is optional and if no configuration file is found, Ghostty will use its defaults.

先ほど作成されたファイルを .config/ghostty に移動してみます。

mv ~/Library/Application\ Support/com.mitchellh.ghostty ~/.config/ghostty

Ghostty を再起動して再度 Settings… を開くと、 .config/ghostty/config を開きました。

config の場所 (移動後)

Mackup に登録

まず、 .mackup.cfg に ghostty を追加しました。

[storage]
engine = dropbox

[applications_to_sync]
fish
ssh
vscode
mendeley
karabiner-elements
ghostty

その後 mackup でバックアップを設定します。

> mackup backup
Backing up .config/ghostty/config ...

念のためバックアップできているかどうかを確認します。

ls -l .config/ghostty/config
lrwxr-xr-x@ 1 hkob  staff  70 Oct  2 16:35 .config/ghostty/config@ -> /Users/hkob/Library/CloudStorage/Dropbox/Mackup/.config/ghostty/config

config で設定できるもの

config を確認すると、以下のように書かれていました。

# Run `ghostty +show-config --default --docs` to view a list of
# all available config options and their default values.

実行したら非常に長い設定項目とその説明が出てきました。翻訳して掲載しようと思いましたが、3510行もあったのであきらめました。

おわりに

config を整理する時間がなかったので、今日はここまでにします。

hkob.notion.site