only add path when open shell under windows

This commit is contained in:
Roy Qu 2023-09-27 13:57:39 +08:00
parent 78f00febbc
commit 039ca4ce9e
1 changed files with 1 additions and 1 deletions

View File

@ -3631,7 +3631,6 @@ void MainWindow::openShell(const QString &folder, const QString &shellCommand, c
args->flags |= CREATE_NEW_CONSOLE;
args->startupInfo->dwFlags &= ~STARTF_USESTDHANDLES; //
});
#endif
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
QString path = env.value("PATH");
QStringList pathAdded;
@ -3644,6 +3643,7 @@ void MainWindow::openShell(const QString &folder, const QString &shellCommand, c
}
env.insert("PATH",path);
process.setProcessEnvironment(env);
#endif
process.startDetached();
}