hb-view: Detect WezTerm and use iterm2 image protocol

Similar to the logic that detects iterm2, but look for
TERM_PROGRAM=WezTerm which identifies wezterm is present.

This allows hb-view to output an image directly to the terminal.
This commit is contained in:
Wez Furlong authored and GitHub committed 2022-09-03 17:15:03 +02:00
1 parent 238e7dd2b6
commit e3548c2069
1 file changed
+6
+6
View File
@@ -410,6 +410,12 @@ helper_cairo_create_context (double w, double h,
extension = "png";
protocol = image_protocol_t::ITERM2;
}
else if ((name = getenv ("TERM_PROGRAM")) != nullptr &&
0 == g_ascii_strcasecmp (name, "WezTerm"))
{
extension = "png";
protocol = image_protocol_t::ITERM2;
}
else if ((name = getenv ("TERM")) != nullptr &&
0 == g_ascii_strcasecmp (name, "xterm-kitty"))
{