diff --git a/src/Application.cpp b/src/Application.cpp index 0a967a5b..c92e96a3 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -72,7 +72,10 @@ void Application::populateCommandLineParser(QCommandLineParser *parser) {{QStringLiteral("p")}, i18nc("@info:shell", "Change the value of a profile property."), QStringLiteral("property=value")}, {{QStringLiteral("e")}, i18nc("@info:shell", "Command to execute. This option will catch all following arguments, so use it as the last option."), - QStringLiteral("cmd")}}; + QStringLiteral("cmd")}, + {{QStringLiteral("force-reuse")}, i18nc("@info:shell", "Force re-using the existing instance even if it breaks functionality, e. g. --new-tab. Mostly for debugging.")}, + }; + for (const auto &option : options) { parser->addOption(option); } diff --git a/src/main.cpp b/src/main.cpp index cf3d7b17..e58f435b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -260,6 +260,10 @@ bool shouldUseNewProcess(int argc, char *argv[]) arguments.append(QString::fromLocal8Bit(argv[i])); } + if (arguments.contains(QLatin1String("--force-reuse"))) { + return false; + } + // take Qt options into consideration QStringList qtProblematicOptions; qtProblematicOptions << QStringLiteral("--session") << QStringLiteral("--name") << QStringLiteral("--reverse") << QStringLiteral("--stylesheet")