mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-26 16:15:25 -07:00
fix
use autocreate pref file. user pref for color/emoji linux
This commit is contained in:
parent
487f359f6b
commit
5df9d3d8f7
2 changed files with 16 additions and 3 deletions
|
@ -476,6 +476,7 @@ static int CmdPrefSet (const char *Cmd)
|
||||||
if (w != -99999) session.window_plot_wsize = w;
|
if (w != -99999) session.window_plot_wsize = w;
|
||||||
// Need to work out how to change live....
|
// Need to work out how to change live....
|
||||||
// calling data plot seems to work
|
// calling data plot seems to work
|
||||||
|
//plotwidget->MoveWindows ();
|
||||||
|
|
||||||
showPlotPosState ();
|
showPlotPosState ();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
|
|
||||||
// Used to enable/disable use of preferences json file
|
// Used to enable/disable use of preferences json file
|
||||||
// #define USE_PREFERENCE_FILE
|
#define USE_PREFERENCE_FILE
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
|
@ -844,10 +844,20 @@ int main(int argc, char *argv[]) {
|
||||||
// For info, grep --color=auto is doing sth like this, plus test getenv("TERM") != "dumb":
|
// For info, grep --color=auto is doing sth like this, plus test getenv("TERM") != "dumb":
|
||||||
// struct stat tmp_stat;
|
// struct stat tmp_stat;
|
||||||
// if ((fstat (STDOUT_FILENO, &tmp_stat) == 0) && (S_ISCHR (tmp_stat.st_mode)) && isatty(STDIN_FILENO))
|
// if ((fstat (STDOUT_FILENO, &tmp_stat) == 0) && (S_ISCHR (tmp_stat.st_mode)) && isatty(STDIN_FILENO))
|
||||||
|
#ifdef USE_PREFERENCE_FILE
|
||||||
|
if (!session.preferences_loaded) {
|
||||||
|
if (session.stdinOnTTY && session.stdoutOnTTY) {
|
||||||
|
session.supports_colors = true;
|
||||||
|
session.emoji_mode = EMOJI;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
if (session.stdinOnTTY && session.stdoutOnTTY) {
|
if (session.stdinOnTTY && session.stdoutOnTTY) {
|
||||||
session.supports_colors = true;
|
session.supports_colors = true;
|
||||||
session.emoji_mode = EMOJI;
|
session.emoji_mode = EMOJI;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// Let's take a baudrate ok for real UART, USB-CDC & BT don't use that info anyway
|
// Let's take a baudrate ok for real UART, USB-CDC & BT don't use that info anyway
|
||||||
if (speed == 0)
|
if (speed == 0)
|
||||||
|
@ -907,8 +917,10 @@ int main(int argc, char *argv[]) {
|
||||||
// Save settings if not load from settings json file.
|
// Save settings if not load from settings json file.
|
||||||
// Doing this here will ensure other checks and updates are saved to over rule default
|
// Doing this here will ensure other checks and updates are saved to over rule default
|
||||||
// e.g. Linux color use check
|
// e.g. Linux color use check
|
||||||
if (!session.preferences_loaded)
|
if (!session.preferences_loaded) {
|
||||||
preferences_save ();
|
preferences_save (); // Save defaults
|
||||||
|
session.preferences_loaded = true;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GUI
|
#ifdef HAVE_GUI
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue