From 6fe1c960f9428a05beb4b2a0bda59d0e35b0a1dc Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Fri, 2 Aug 2024 08:10:58 -0400 Subject: [PATCH 1/6] Auto-detect other terminals supporting the Kitty protocol --- src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 9dfcaed..15c2f6d 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("GHOSTTY_RESOURCES_DIR").is_ok() + || env::var("KONSOLE_VERSION").is_ok() + { protocol::ImageProtocol::Kitty } else { protocol::ImageProtocol::Iterm2 From d4459dfeb6a29f7e053b8133ee1efe92f457fb81 Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Fri, 2 Aug 2024 08:12:31 -0400 Subject: [PATCH 2/6] docs: update readme for new supported terminals --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f5da7ca..fd29941 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 protocal 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. From e215df96dd15ec9d83061b928cbb0c473b05882d Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Fri, 2 Aug 2024 08:50:32 -0400 Subject: [PATCH 3/6] Add Ghostty to supported terminal graphics protocol terminals --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fd29941..2c028ce 100644 --- a/README.md +++ b/README.md @@ -249,6 +249,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://github.com/ghostty-org) | ○ | | ### Reporting Compatibility From 21ecbb062355c1e8227faced3c625d81d52701d9 Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Fri, 2 Aug 2024 08:52:14 -0400 Subject: [PATCH 4/6] Use `TERM_PROGRAM` to match Ghostty, remove Konsole mentions/support --- README.md | 2 +- src/lib.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2c028ce..d84cc91 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 protocal for the current terminal. -Kitty, Ghostty, and Konsole terminals are detected as `kitty` via environment variables, and all others are assumed to support `iterm`. +The Kitty and Ghostty terminals are detected as `kitty` via environment variables, and all others are assumed to support `iterm`. Refer to [Compatibility](#compatibility) for details. diff --git a/src/lib.rs b/src/lib.rs index 15c2f6d..7445837 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -102,9 +102,7 @@ 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() - || env::var("GHOSTTY_RESOURCES_DIR").is_ok() - || env::var("KONSOLE_VERSION").is_ok() + if env::var("KITTY_WINDOW_ID").is_ok() || env::var("TERM_PROGRAM").is_ok_and(|t| t == "ghostty") { protocol::ImageProtocol::Kitty } else { From b8ccbc0f684143f3e3e032673bd4d4b4febaca87 Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Fri, 2 Aug 2024 08:57:29 -0400 Subject: [PATCH 5/6] Add Konsole detection and mention support in readme --- README.md | 3 ++- src/lib.rs | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d84cc91..205c64d 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 protocal for the current terminal. -The Kitty and Ghostty terminals are detected as `kitty` via environment variables, 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. @@ -250,6 +250,7 @@ The terminals on which each has been confirmed to work are listed below. | ----------------------------------------- | ------- | ---- | | [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 7445837..1d00011 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -102,7 +102,9 @@ 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() || env::var("TERM_PROGRAM").is_ok_and(|t| t == "ghostty") + 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 { From b24089478518a2de23cdee076331a76e530c7b36 Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Wed, 7 Aug 2024 09:31:20 -0400 Subject: [PATCH 6/6] Fix typo from merge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ae3576d..754c8db 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ Options: #### -p, --protocol \ A protocol type for rendering images of commit graphs. -By default `auto` will guess the best supported protocal for the current terminal. +By default `auto` will guess the best supported protocol for the current terminal. 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.