mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-19 15:04:45 +00:00
add PI_NO_IMAGES env var to disable inline image rendering
This commit is contained in:
parent
9e9d5c94ed
commit
f603a377ae
2 changed files with 62 additions and 0 deletions
|
|
@ -28,6 +28,12 @@ export function detectCapabilities(): TerminalCapabilities {
|
|||
const termProgram = process.env.TERM_PROGRAM?.toLowerCase() || "";
|
||||
const term = process.env.TERM?.toLowerCase() || "";
|
||||
const colorTerm = process.env.COLORTERM?.toLowerCase() || "";
|
||||
const disableImages = process.env.PI_NO_IMAGES === "1" || process.env.PI_NO_IMAGES === "true";
|
||||
|
||||
if (disableImages) {
|
||||
const trueColor = colorTerm === "truecolor" || colorTerm === "24bit";
|
||||
return { images: null, trueColor, hyperlinks: true };
|
||||
}
|
||||
|
||||
if (process.env.KITTY_WINDOW_ID || termProgram === "kitty") {
|
||||
return { images: "kitty", trueColor: true, hyperlinks: true };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue