ide, Core: Console application started by F5 (debug) now waits before closing the console window

This commit is contained in:
Mirek Fidler 2026-07-31 11:16:58 +02:00
parent abe05eeee9
commit 74f1fd223d
5 changed files with 18 additions and 9 deletions

View file

@ -621,6 +621,13 @@ void AppExit__()
#ifdef PLATFORM_POSIX
MemoryIgnoreLeaksBegin(); // Qt leaks on app exit...
#endif
#ifndef flagGUI
if(GetEnv("UPP_EXIT_PAUSE__") == "1") { // this is an ugly way to prevent close of console on F5 (debug)
Cout() << "<--- Finished, press [ENTER] to close the window --->\n";
ReadStdIn();
}
#endif
}
#ifdef flagTURTLE // Turtle web backend

View file

@ -94,7 +94,7 @@ String NoCr(const char *s)
return out;
}
void MakeBuild::CreateHost(Host& host, const String& method, bool darkmode, bool disable_uhd, int scale)
void MakeBuild::CreateHost(Host& host, const String& method, bool darkmode, bool disable_uhd, int scale, bool exit_pause)
{
VectorMap<String, String> bm = GetMethodVars(method);
{
@ -116,6 +116,8 @@ void MakeBuild::CreateHost(Host& host, const String& method, bool darkmode, bool
env.GetAdd("UPP_DARKMODE__") = "1";
if(scale)
env.GetAdd("UPP_SCALE__") = AsString(scale);
if(exit_pause)
env.GetAdd("UPP_EXIT_PAUSE__") = "1";
// setup LD_LIBRARY_PATH on target dir, needed for all shared builds on posix
#ifdef PLATFORM_POSIX
if(target != "")
@ -147,10 +149,10 @@ void MakeBuild::CreateHost(Host& host, const String& method, bool darkmode, bool
}
}
void MakeBuild::CreateHost(Host& host, bool darkmode, bool disable_uhd, int scale)
void MakeBuild::CreateHost(Host& host, bool darkmode, bool disable_uhd, int scale, bool exit_pause)
{
SetupDefaultMethod();
CreateHost(host, method, darkmode, disable_uhd, scale);
CreateHost(host, method, darkmode, disable_uhd, scale, exit_pause);
}
One<Builder> MakeBuild::CreateBuilder(Host *host)

View file

@ -68,8 +68,8 @@ public:
bool makefile_svn_revision = true;
void CreateHost(Host& host, const String& method, bool darkmode, bool disable_uhd, int scale);
void CreateHost(Host& host, bool darkmode = false, bool disable_uhd = false, int scale = 0);
void CreateHost(Host& host, const String& method, bool darkmode, bool disable_uhd, int scale, bool exit_pause);
void CreateHost(Host& host, bool darkmode = false, bool disable_uhd = false, int scale = 0, bool exit_pause = false);
const TargetMode& GetTargetMode();
Index<String> PackageConfig(const Workspace& wspc, int package, const VectorMap<String, String>& bm,

View file

@ -115,9 +115,9 @@ void Ide::RunArgs() {
}
}
void Ide::CreateHostRunDir(Host& h)
void Ide::CreateHostRunDir(Host& h, bool exit_pause)
{
CreateHost(h, darkmode, disable_uhd, scale);
CreateHost(h, darkmode, disable_uhd, scale, exit_pause);
if(IsNull(rundir))
h.ChDir(GetFileFolder(target));
else
@ -358,7 +358,7 @@ void Ide::BuildAndDebug(bool runto)
if(designer && !editfile_isfolder)
EditAsText();
Host host;
CreateHostRunDir(host);
CreateHostRunDir(host, true);
host.ChDir(Nvl(rundir, GetFileFolder(target)));
editor.Disable();

View file

@ -965,7 +965,7 @@ public:
void FileCompile();
void Preprocess(bool asmout);
void ToggleStopOnErrors();
void CreateHostRunDir(Host& h);
void CreateHostRunDir(Host& h, bool exit_pause = false);
void DebugMenu(Bar& menu);
void RunArgs();