diff --git a/README.md b/README.md index 3bb9be6..754c8db 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ Options: A protocol type for rendering images of commit graphs. By default `auto` will guess the best supported protocol for the current terminal. -Kitty terminals are detected as `kitty` via an environment variable, and all others are assumed to support `iterm`. +Kitty, Ghostty, and Konsole terminals are detected as `kitty` via environment variables, and all others are assumed to support `iterm`. Refer to [Compatibility](#compatibility) for details. @@ -249,6 +249,8 @@ 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://github.com/ghostty-org) | ○ | | +| [Konsole](https://konsole.kde.org/) | ○ | | ### Reporting Compatibility diff --git a/src/lib.rs b/src/lib.rs index 9dfcaed..1d00011 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -102,7 +102,10 @@ fn initialize_panic_handler() { // By default assume the Iterm2 is the best protocol to use for all terminals *unless* an env // variable is set that suggests the terminal is probably Kitty. fn auto_detect_best_protocol() -> protocol::ImageProtocol { - if env::var("KITTY_WINDOW_ID").is_ok() { + if env::var("KITTY_WINDOW_ID").is_ok() + || env::var("TERM_PROGRAM").is_ok_and(|t| t == "ghostty") + || env::var("KONSOLE_VERSION").is_ok() + { protocol::ImageProtocol::Kitty } else { protocol::ImageProtocol::Iterm2