SSH: Fix running remote process in terminal

ConsoleProcess stumbles over the special characters in the remote
command and as a result silently runs the command locally instead.
Prevent that. We can (and should) simply leave these characters alone,
as they have no special meaning on the local machine.

Change-Id: I31b3afe1cf170e51d431372b15f4df3656006959
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2019-06-14 13:37:20 +02:00
parent cd8ebb21e3
commit acfe45c434
6 changed files with 15 additions and 8 deletions

View File

@@ -65,7 +65,7 @@ void ConsoleProcess::setSettings(QSettings *settings)
d->m_settings = settings;
}
bool ConsoleProcess::start(const QString &program, const QString &args)
bool ConsoleProcess::start(const QString &program, const QString &args, MetaCharMode metaCharMode)
{
if (isRunning())
return false;
@@ -75,7 +75,8 @@ bool ConsoleProcess::start(const QString &program, const QString &args)
QtcProcess::SplitError perr;
QtcProcess::Arguments pargs = QtcProcess::prepareArgs(args, &perr, HostOsInfo::hostOs(),
&d->m_environment, &d->m_workingDir);
&d->m_environment, &d->m_workingDir,
metaCharMode == MetaCharMode::Abort);
QString pcmd;
if (perr == QtcProcess::SplitOk) {
pcmd = program;