Skip to content

Commit fb8a04f

Browse files
committed
Logo: don't load text files as image file
Fix #1843
1 parent c3ce5ac commit fb8a04f

1 file changed

Lines changed: 22 additions & 19 deletions

File tree

src/logo/logo.c

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -651,25 +651,28 @@ void ffLogoPrint(void)
651651
//Make sure the logo path is set correctly.
652652
updateLogoPath();
653653

654-
const FFTerminalResult* terminal = ffDetectTerminal();
655-
656-
//Terminal emulators that support kitty graphics protocol.
657-
bool supportsKitty =
658-
ffStrbufIgnCaseEqualS(&terminal->processName, "kitty") ||
659-
ffStrbufIgnCaseEqualS(&terminal->processName, "konsole") ||
660-
ffStrbufIgnCaseEqualS(&terminal->processName, "wezterm") ||
661-
ffStrbufIgnCaseEqualS(&terminal->processName, "wayst") ||
662-
ffStrbufIgnCaseEqualS(&terminal->processName, "ghostty") ||
663-
#ifdef __APPLE__
664-
ffStrbufIgnCaseEqualS(&terminal->processName, "WarpTerminal") ||
665-
#else
666-
ffStrbufIgnCaseEqualS(&terminal->processName, "warp") ||
667-
#endif
668-
false;
669-
670-
//Try to load the logo as an image. If it succeeds, print it and return.
671-
if(logoPrintImageIfExists(supportsKitty ? FF_LOGO_TYPE_IMAGE_KITTY : FF_LOGO_TYPE_IMAGE_CHAFA, false))
672-
return;
654+
if (!ffStrbufEndsWithIgnCaseS(&options->source, ".txt"))
655+
{
656+
const FFTerminalResult* terminal = ffDetectTerminal();
657+
658+
//Terminal emulators that support kitty graphics protocol.
659+
bool supportsKitty =
660+
ffStrbufIgnCaseEqualS(&terminal->processName, "kitty") ||
661+
ffStrbufIgnCaseEqualS(&terminal->processName, "konsole") ||
662+
ffStrbufIgnCaseEqualS(&terminal->processName, "wezterm") ||
663+
ffStrbufIgnCaseEqualS(&terminal->processName, "wayst") ||
664+
ffStrbufIgnCaseEqualS(&terminal->processName, "ghostty") ||
665+
#ifdef __APPLE__
666+
ffStrbufIgnCaseEqualS(&terminal->processName, "WarpTerminal") ||
667+
#else
668+
ffStrbufIgnCaseEqualS(&terminal->processName, "warp") ||
669+
#endif
670+
false;
671+
672+
//Try to load the logo as an image. If it succeeds, print it and return.
673+
if(logoPrintImageIfExists(supportsKitty ? FF_LOGO_TYPE_IMAGE_KITTY : FF_LOGO_TYPE_IMAGE_CHAFA, false))
674+
return;
675+
}
673676

674677
//Try to load the logo as a file. If it succeeds, print it and return.
675678
if(logoPrintFileIfExists(true, false))

0 commit comments

Comments
 (0)