mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-10 00:40:09 +01:00
Logo: disable image logos in ssh and tmux sessions
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#include "image.h"
|
#include "image.h"
|
||||||
#include "common/io/io.h"
|
#include "common/io/io.h"
|
||||||
#include "common/printing.h"
|
#include "common/printing.h"
|
||||||
|
#include "util/stringUtils.h"
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
@@ -839,6 +840,22 @@ bool ffLogoPrintImageIfExists(FFLogoType type, bool printError)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getenv("SSH_TTY"))
|
||||||
|
{
|
||||||
|
if(printError)
|
||||||
|
fputs("Logo: Image logo is not supported in SSH sessions\n", stderr);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* term = getenv("TERM");
|
||||||
|
if((term && ffStrEquals(term, "screen")) || getenv("ZELLIJ") || getenv("TMUX"))
|
||||||
|
{
|
||||||
|
if(printError)
|
||||||
|
fputs("Logo: Image logo is not supported in terminal multiplexers\n", stderr);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(type == FF_LOGO_TYPE_IMAGE_ITERM)
|
if(type == FF_LOGO_TYPE_IMAGE_ITERM)
|
||||||
return printImageIterm();
|
return printImageIterm();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user