From 3764b02a2e624e63ab1e1c8cb4382ba4eb388fe0 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 27 Aug 2017 08:50:55 +0200 Subject: [PATCH] FIX: when running on ssh, client would fail. see https://github.com/Proxmark/proxmark3/pull/387 (thanks @uzlonewolf) --- client/proxmark3.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/client/proxmark3.c b/client/proxmark3.c index b10385383..7b80da0b6 100644 --- a/client/proxmark3.c +++ b/client/proxmark3.c @@ -306,8 +306,21 @@ int main(int argc, char* argv[]) { pthread_mutex_init(&print_lock, NULL); #ifdef HAVE_GUI + +# if _WIN32 InitGraphics(argc, argv, script_cmds_file, usb_present); MainGraphics(); +# else + // for *nix distro's, check enviroment variable to verify a display + char* display = getenv("DISPLAY"); + if (display && strlen(display) > 1) { + InitGraphics(argc, argv, script_cmds_file, usb_present); + MainGraphics(); + } else { + main_loop(script_cmds_file, usb_present); + } +# endif + #else main_loop(script_cmds_file, usb_present); #endif