Utils: Add a QtcProcess flag to keep stdin open

Needed to run e.g. gdb on-device.

Change-Id: I5a98df575478f18adf1540ced44f6808bdba0b76
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-06-21 15:13:22 +02:00
parent 6acc10a8bd
commit 76cf6ce983
4 changed files with 17 additions and 0 deletions

View File

@@ -946,6 +946,8 @@ void DockerDevice::runProcess(QtcProcess &process) const
CommandLine cmd{"docker", {"exec"}};
cmd.addArgs({"-w", workingDir.path()});
if (process.keepsWriteChannelOpen())
cmd.addArg("-i");
cmd.addArg(d->m_container);
cmd.addArg(origCmd.executable().path()); // Cut off the docker://.../ bits.
cmd.addArgs(origCmd.splitArguments(osType()));