- fix: Option 'Pause after run in console' for tools doesn't work.

This commit is contained in:
Roy Qu 2024-03-21 17:54:58 +08:00
parent 5b77c6f3fb
commit 5b328f1e1a
4 changed files with 21 additions and 8 deletions

View File

@ -70,6 +70,7 @@ Red Panda C++ Version 2.27
- fix: '*=' is treadted as '*' when parsing.
- fix: Can't correctly retrieve function parameters type.
- fix: Auto type induction for expression contains '[]' are not correct.
- fix: Option 'Pause after run in console' for tools doesn't work.
Red Panda C++ Version 2.26
- enhancement: Code suggestion for embedded std::vectors.

View File

@ -36,12 +36,6 @@
#include <sys/posix_shm.h>
#endif
enum RunProgramFlag {
RPF_PAUSE_CONSOLE = 0x0001,
RPF_REDIRECT_INPUT = 0x0002,
RPF_ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004
};
CompilerManager::CompilerManager(QObject *parent) : QObject(parent),
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
mCompileMutex(),

View File

@ -23,6 +23,12 @@
#include "../utils.h"
#include "../common.h"
enum RunProgramFlag {
RPF_PAUSE_CONSOLE = 0x0001,
RPF_REDIRECT_INPUT = 0x0002,
RPF_ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004
};
class Runner;
class Project;
class Compiler;

View File

@ -3443,9 +3443,15 @@ void MainWindow::updateTools()
+ LINE_BREAKER);
file.close();
if (item->pauseAfterExit) {
QString sharedMemoryId = QUuid::createUuid().toString();
QStringList execArgs = QStringList{
QString::number(RPF_PAUSE_CONSOLE),
sharedMemoryId,
localizePath(file.fileName())
};
executeFile(
includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+CONSOLE_PAUSER,
{"1", localizePath(file.fileName())},
execArgs,
workDir, file.fileName());
} else {
executeFile(
@ -3456,9 +3462,15 @@ void MainWindow::updateTools()
}
} else {
if (item->pauseAfterExit) {
QString sharedMemoryId = QUuid::createUuid().toString();
QStringList execArgs = QStringList{
QString::number(RPF_PAUSE_CONSOLE),
sharedMemoryId,
localizePath(program)
};
executeFile(
includeTrailingPathDelimiter(pSettings->dirs().appLibexecDir())+CONSOLE_PAUSER,
QStringList{"1", program} + params,
execArgs + params,
workDir, "");
} else {
executeFile(