diff --git a/src/lpm.c b/src/lpm.c index 3fa7717..452d864 100644 --- a/src/lpm.c +++ b/src/lpm.c @@ -1998,6 +1998,10 @@ int main(int argc, char* argv[]) { #else lua_pushboolean(L, isatty(fileno(stdout))); #endif + #if _WIN32 + lua_pushboolean(L, GetConsoleProcessList(&(DWORD){ 0 }, 1) == 1); + lua_setglobal(L, "LPM_RUN_FROM_GUI"); + #endif lua_setglobal(L, "TTY"); #if _WIN32 lua_pushliteral(L, "\\"); diff --git a/src/lpm.lua b/src/lpm.lua index fe60af3..0ddd750 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -2588,6 +2588,10 @@ not commonly used publically. [target] target, or the current working directory. ]] ) + if LPM_RUN_FROM_GUI then + io.stderr:write(colorize("\n\nYou can close this window by pressing Enter.", "cyan")) + io.stdin:read("*l") + end return 0 end