forked from qt-creator/qt-creator
Utils: Re-add "press enter to continue" to stub
To keep the terminal from closing immediately, ask the user to press enter after the inferior exited. Make it configurable as the terminal plugin does not need this. Change-Id: I1949895f022a54539a6139be9f92fdc698f6534e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -172,6 +172,11 @@ void doExit(int exitCode)
|
||||
if (controlSocket.state() == QLocalSocket::ConnectedState && controlSocket.bytesToWrite())
|
||||
controlSocket.waitForBytesWritten(1000);
|
||||
|
||||
if (!commandLineParser.value("wait").isEmpty()) {
|
||||
std::cout << commandLineParser.value("wait").toStdString();
|
||||
std::cin.get();
|
||||
}
|
||||
|
||||
exit(exitCode);
|
||||
}
|
||||
|
||||
@@ -394,6 +399,11 @@ std::optional<int> tryParseCommandLine(QCoreApplication &app)
|
||||
QCommandLineOption({"w", "workingDir"}, "Working directory for inferior", "workingDir"));
|
||||
commandLineParser.addOption(QCommandLineOption({"v", "verbose"}, "Print debug messages"));
|
||||
commandLineParser.addOption(QCommandLineOption({"e", "envfile"}, "Path to env file", "envfile"));
|
||||
commandLineParser.addOption(
|
||||
QCommandLineOption("wait",
|
||||
"Message to display to the user while waiting for key press",
|
||||
"waitmessage",
|
||||
"Press enter to continue ..."));
|
||||
|
||||
commandLineParser.process(app);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user