diff --git a/README.md b/README.md index f25fbd3..ee573f2 100644 --- a/README.md +++ b/README.md @@ -314,7 +314,7 @@ The terminals on which each has been confirmed to work are listed below. | Terminal emulator | Support | Note | | -------------------------------------------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- | | [iTerm2](https://iterm2.com) | ○ | But slower than other terminals | -| [WezTerm](https://wezfurlong.org/wezterm/index.html) | ○ | | +| [WezTerm](https://wezfurlong.org/wezterm/) | ○ | | | [VSCode integrated terminal](https://code.visualstudio.com/docs/terminal/basics) | ○ | Requires the [`terminal.integrated.enableImages` setting](https://code.visualstudio.com/docs/terminal/advanced#_image-support) to be enabled | | [Hyper](https://hyper.is) | △ | >=[v4.0.0](https://github.com/vercel/hyper/releases/tag/v4.0.0-canary.4), not yet officially released | | [Tabby](https://tabby.sh) | △ | The graph background is not transparent | @@ -324,6 +324,7 @@ The terminals on which each has been confirmed to work are listed below. | Terminal emulator | Support | Note | | ----------------------------------------- | ------- | ---- | | [kitty](https://sw.kovidgoyal.net/kitty/) | ○ | | +| [Ghostty](https://ghostty.org) | ○ | | ### Unsupported environments diff --git a/src/protocol.rs b/src/protocol.rs index aa019d5..a260b95 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -7,10 +7,13 @@ use base64::Engine; pub fn auto_detect() -> ImageProtocol { // https://sw.kovidgoyal.net/kitty/glossary/#envvar-KITTY_WINDOW_ID if env::var("KITTY_WINDOW_ID").is_ok() { - ImageProtocol::Kitty - } else { - ImageProtocol::Iterm2 + return ImageProtocol::Kitty; } + // https://ghostty.org/docs/help/terminfo + if env::var("TERM").is_ok_and(|t| t == "xterm-ghostty") { + return ImageProtocol::Kitty; + } + ImageProtocol::Iterm2 } #[derive(Debug, Clone, Copy)]