File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -263,7 +263,6 @@ void QuickshellGlobal::execDetached(const qs::io::process::ProcessContext& conte
263
263
auto args = context.command .sliced (1 );
264
264
265
265
QProcess process;
266
-
267
266
qs::io::process::setupProcessEnvironment (&process, context.clearEnvironment , context.environment );
268
267
269
268
if (!context.workingDirectory .isEmpty ()) {
@@ -272,6 +271,14 @@ void QuickshellGlobal::execDetached(const qs::io::process::ProcessContext& conte
272
271
273
272
process.setProgram (cmd);
274
273
process.setArguments (args);
274
+
275
+ process.setStandardInputFile (QProcess::nullDevice ());
276
+
277
+ if (context.unbindStdout ) {
278
+ process.setStandardOutputFile (QProcess::nullDevice ());
279
+ process.setStandardErrorFile (QProcess::nullDevice ());
280
+ }
281
+
275
282
process.startDetached ();
276
283
}
277
284
Original file line number Diff line number Diff line change @@ -249,6 +249,11 @@ void Process::startDetached() {
249
249
this ->setupEnvironment (&process);
250
250
process.setProgram (cmd);
251
251
process.setArguments (args);
252
+
253
+ process.setStandardInputFile (QProcess::nullDevice ());
254
+ process.setStandardOutputFile (QProcess::nullDevice ());
255
+ process.setStandardErrorFile (QProcess::nullDevice ());
256
+
252
257
process.startDetached ();
253
258
}
254
259
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ class ProcessContext {
16
16
Q_PROPERTY (QHash<QString, QVariant> environment MEMBER environment WRITE setEnvironment);
17
17
Q_PROPERTY (bool clearEnvironment MEMBER clearEnvironment WRITE setClearEnvironment);
18
18
Q_PROPERTY (QString workingDirectory MEMBER workingDirectory WRITE setWorkingDirectory);
19
+ Q_PROPERTY (bool unbindStdout MEMBER unbindStdout WRITE setUnbindStdout);
19
20
Q_GADGET;
20
21
QML_STRUCTURED_VALUE;
21
22
QML_VALUE_TYPE (processContext);
@@ -45,6 +46,8 @@ class ProcessContext {
45
46
this ->workingDirectorySet = true ;
46
47
}
47
48
49
+ void setUnbindStdout (bool unbindStdout) { this ->unbindStdout = unbindStdout; }
50
+
48
51
QList<QString> command;
49
52
QHash<QString, QVariant> environment;
50
53
bool clearEnvironment = false ;
@@ -54,6 +57,7 @@ class ProcessContext {
54
57
bool environmentSet : 1 = false ;
55
58
bool clearEnvironmentSet : 1 = false ;
56
59
bool workingDirectorySet : 1 = false ;
60
+ bool unbindStdout : 1 = true ;
57
61
};
58
62
59
63
void setupProcessEnvironment (
You can’t perform that action at this time.
0 commit comments