--images kitty emits raw kitty graphics escapes with no check for a multiplexer. tmux requires graphics sequences to be wrapped in DCS passthrough, and screen doesn't support them at all, so running mdriver --images kitty inside either garbles the screen rather than degrading to alt text.
There's currently no terminal/environment detection anywhere in the codebase — the only env vars read are MDRIVER_THEME, MDRIVER_WIDTH and MDRIVER_PADDING (src/main.rs:292-303).
Minimum fix: if TMUX is set, or TERM starts with tmux or screen, disable image rendering and fall back to alt text. A warn\! explaining why would fit the existing logging setup.
Possible follow-on: accept --images auto as a third value that enables kitty only on positively-identified capable terminals, leaving the explicit --images kitty as a force. Unlike hyperlinks, image support is cheap to detect from the environment (KITTY_WINDOW_ID, GHOSTTY_RESOURCES_DIR, WEZTERM_PANE, TERM_PROGRAM, etc.) — pi's table in packages/tui/src/terminal-image.ts (detectCapabilitiesFromEnvironment) is a reasonable starting list.
Related: #87 (the same question for OSC8 hyperlinks).
--images kittyemits raw kitty graphics escapes with no check for a multiplexer. tmux requires graphics sequences to be wrapped in DCS passthrough, and screen doesn't support them at all, so runningmdriver --images kittyinside either garbles the screen rather than degrading to alt text.There's currently no terminal/environment detection anywhere in the codebase — the only env vars read are
MDRIVER_THEME,MDRIVER_WIDTHandMDRIVER_PADDING(src/main.rs:292-303).Minimum fix: if
TMUXis set, orTERMstarts withtmuxorscreen, disable image rendering and fall back to alt text. Awarn\!explaining why would fit the existing logging setup.Possible follow-on: accept
--images autoas a third value that enables kitty only on positively-identified capable terminals, leaving the explicit--images kittyas a force. Unlike hyperlinks, image support is cheap to detect from the environment (KITTY_WINDOW_ID,GHOSTTY_RESOURCES_DIR,WEZTERM_PANE,TERM_PROGRAM, etc.) — pi's table inpackages/tui/src/terminal-image.ts(detectCapabilitiesFromEnvironment) is a reasonable starting list.Related: #87 (the same question for OSC8 hyperlinks).