mirror of
https://github.com/kingToolbox/WindTerm.git
synced 2025-01-29 06:40:31 +08:00
[BugFix] WinPty can not launch applications with spaces in the path.
This commit is contained in:
parent
8a0d506c52
commit
150635107e
@ -54,8 +54,19 @@ bool WinPty::createProcess(QString command, const QString &arguments,
|
||||
errorString = tr("Winpty-agent.exe or winpty.dll not found!.");
|
||||
break;
|
||||
}
|
||||
command = command.trimmed();
|
||||
|
||||
if (command.startsWith("\"") && command.endsWith("\"")) {
|
||||
command.remove(command.length() - 1, 1);
|
||||
command.remove(0, 1);
|
||||
}
|
||||
|
||||
QString commandWithArguments = command;
|
||||
|
||||
if (commandWithArguments.contains(' ')) {
|
||||
commandWithArguments.prepend("\"").append("\"");
|
||||
}
|
||||
|
||||
if (arguments.isEmpty() == false) {
|
||||
commandWithArguments.append(" ").append(arguments);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user