Skip to content

ghostty

GhosttyからリモートのLinuxへSSHした際、プロンプトの色などが正しく表示されない問題を解決する

Ghosttyで開始したシェルから別のLinuxサーバへSSHしたところ、プロンプトの色が正しく表示されませんでした。Terminfoには以下の記載がありました。

Ghostty's terminfo entry is available in ncurses 6.5-20241228 and above. As distros update their ncurses packages, Ghostty's terminfo entry will be available by default system-wide. This will take time to propagate.

確かに、デフォルト状態のGhosttyはTERM環境変数として(xterm-256colorなどではなく)xterm-ghosttyという文字列を送信していました。これを回避する手段として同ページに以下の記載がありました。

Both variants can be automated by specifying one or both of the following in your Ghostty configuration:

  1. shell-integration-features = ssh-terminfo to copy the terminfo entry the first time you log into a new server over SSH.
  2. shell-integration-features = ssh-env to configure SSH to fall back to xterm-256color.

Ghostty v1.2.3では「ひとつのキーバインドで複数アクションの実行」はできない

Ghosttyは設定を柔軟にカスタマイズできます。ただ、バージョン1.2.3時点では「ひとつのキーバインドで複数のアクションを実行することはできない」ようです。これを実現する拡張については以下のGitHub Issueで提案されており、今のところバージョン1.3.0での実装を目指しているようです。

Ghosttyのデフォルト設定

Ghosttyのデフォルト設定は以下を実行することで表示することができます。今回は「コメントあり」のデフォルト設定をメモしておきます。

コメントあり
ghostty +show-config --default --docs
コメントなし
ghostty +show-config --default --docs