use pid + sequential number in terminal app id (#448)
This commit is contained in:
parent
26a2f44006
commit
d7df8248ab
|
@ -138,7 +138,7 @@
|
||||||
{
|
{
|
||||||
"name": "Elementary Terminal",
|
"name": "Elementary Terminal",
|
||||||
"path": "io.elementary.terminal",
|
"path": "io.elementary.terminal",
|
||||||
"argsPattern": "$term --gapplication-app-id $random_app_id -e \"$unix_command\"",
|
"argsPattern": "$term --gapplication-app-id $sequential_app_id -e \"$unix_command\"",
|
||||||
"comment": "confirm to quit"
|
"comment": "confirm to quit"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -150,7 +150,7 @@
|
||||||
{
|
{
|
||||||
"name": "GNOME Console",
|
"name": "GNOME Console",
|
||||||
"path": "kgx",
|
"path": "kgx",
|
||||||
"argsPattern": "$term --gapplication-app-id $random_app_id -- $argv",
|
"argsPattern": "$term --gapplication-app-id $sequential_app_id -- $argv",
|
||||||
"comment": "confirm to quit"
|
"comment": "confirm to quit"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -4134,7 +4134,7 @@ const QMap<QString, QString> Settings::Environment::mTerminalArgsPatternMagicVar
|
||||||
{"dos_command", "$dos_command"},
|
{"dos_command", "$dos_command"},
|
||||||
{"lpCommandLine", "$lpCommandLine"},
|
{"lpCommandLine", "$lpCommandLine"},
|
||||||
{"tmpfile", "$tmpfile"},
|
{"tmpfile", "$tmpfile"},
|
||||||
{"random_app_id", "$random_app_id"},
|
{"sequential_app_id", "$sequential_app_id"},
|
||||||
};
|
};
|
||||||
|
|
||||||
Settings::Executor::Executor(Settings *settings):_Base(settings, SETTING_EXECUTOR)
|
Settings::Executor::Executor(Settings *settings):_Base(settings, SETTING_EXECUTOR)
|
||||||
|
|
|
@ -754,9 +754,10 @@ std::tuple<QString, QStringList, PNonExclusiveTemporaryFileOwner> wrapCommandFor
|
||||||
QFile(temproryFile->fileName()).setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner | QFileDevice::ExeOwner);
|
QFile(temproryFile->fileName()).setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner | QFileDevice::ExeOwner);
|
||||||
}
|
}
|
||||||
wrappedArgs.push_back(temproryFile->fileName());
|
wrappedArgs.push_back(temproryFile->fileName());
|
||||||
} else if (patternItem == "$random_app_id") {
|
} else if (patternItem == "$sequential_app_id") {
|
||||||
QString randomSuffix = QString::number(QRandomGenerator::global()->generate());
|
static QString prefix = QStringLiteral("io.redpanda.term_%1_").arg(QCoreApplication::applicationPid());
|
||||||
QString appId = "io.redpanda.term" + randomSuffix;
|
static std::atomic<int> appIdCounter = 0;
|
||||||
|
QString appId = prefix + QString::number(++appIdCounter);
|
||||||
wrappedArgs.push_back(appId);
|
wrappedArgs.push_back(appId);
|
||||||
} else
|
} else
|
||||||
wrappedArgs.push_back(patternItem);
|
wrappedArgs.push_back(patternItem);
|
||||||
|
|
Loading…
Reference in New Issue