Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChafaTermDb: Eat understands sixel graphics #198

Merged
merged 1 commit into from Apr 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions chafa/chafa-term-db.c
Expand Up @@ -392,6 +392,7 @@ detect_capabilities (ChafaTermInfo *ti, gchar **envp)
const gchar *mlterm;
const gchar *nvim;
const gchar *nvim_tui_enable_true_color;
const gchar *eat_shell_integration_dir;
gchar *comspec = NULL;
const SeqStr **color_seq_list = color_256_list;
const SeqStr *gfx_seqs = NULL;
Expand All @@ -411,6 +412,7 @@ detect_capabilities (ChafaTermInfo *ti, gchar **envp)
mlterm = getenv_or_blank (envp, "MLTERM");
nvim = getenv_or_blank (envp, "NVIM");
nvim_tui_enable_true_color = getenv_or_blank (envp, "NVIM_TUI_ENABLE_TRUE_COLOR");
eat_shell_integration_dir = getenv_or_blank (envp, "EAT_SHELL_INTEGRATION_DIR");

/* The MS Windows 10 TH2 (v1511+) console supports ANSI escape codes,
* including AIX and DirectColor sequences. We detect this early and allow
Expand Down Expand Up @@ -544,6 +546,11 @@ detect_capabilities (ChafaTermInfo *ti, gchar **envp)
if (!strcmp (term, "rxvt-unicode"))
color_seq_list = color_16_list;

/* Eat uses the "eat-" prefix for TERM.
* Eat also sets EAT_SHELL_INTEGRATION_DIR in the environment. */
if (!strncmp (term, "eat-", 4) || strcmp (eat_shell_integration_dir, ""))
gfx_seqs = sixel_seqs;

/* 'screen' does not like truecolor at all, but 256 colors works fine.
* Sometimes we'll see the outer terminal appended to the TERM string,
* like so: screen.xterm-256color */
Expand Down