mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
Simplify color & banner logic
This commit is contained in:
parent
a91d0a7b19
commit
0a4b90ac20
12 changed files with 77 additions and 72 deletions
12
client/ui.c
12
client/ui.c
|
@ -16,10 +16,7 @@
|
|||
#endif
|
||||
|
||||
#include "ui.h"
|
||||
#if defined(__linux__) || (__APPLE__)
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
session_arg_t session;
|
||||
|
||||
double CursorScaleFactor = 1;
|
||||
int PlotGridX = 0, PlotGridY = 0, PlotGridXdefault = 64, PlotGridYdefault = 64;
|
||||
|
@ -179,12 +176,7 @@ void PrintAndLog(const char *fmt, ...) {
|
|||
vsnprintf(buffer, sizeof(buffer), fmt, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
bool filter_ansi = true;
|
||||
#if defined(__linux__) || (__APPLE__)
|
||||
struct stat tmp_stat;
|
||||
if ((fstat (STDOUT_FILENO, &tmp_stat) == 0) && (S_ISCHR (tmp_stat.st_mode)) && isatty(STDIN_FILENO))
|
||||
filter_ansi = false;
|
||||
#endif
|
||||
bool filter_ansi = !session.supports_colors;
|
||||
memcpy_filter_ansi(buffer2, buffer, sizeof(buffer), filter_ansi);
|
||||
printf("%s", buffer2);
|
||||
printf(" "); // cleaning prompt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue