diff --git a/src/SessionController.cpp b/src/SessionController.cpp --- a/src/SessionController.cpp +++ b/src/SessionController.cpp @@ -348,7 +348,8 @@ } else if (url.scheme().isEmpty()) { // QUrl couldn't parse what the user entered into the URL field // so just dump it to the shell - QString command = url.toDisplayString(); + // If you change this, change it also in autotests/BookMarkTest.cpp + QString command = QUrl::fromPercentEncoding(url.toEncoded()); if (!command.isEmpty()) { _session->sendTextToTerminal(command, QLatin1Char('\r')); } diff --git a/src/autotests/BookMarkTest.cpp b/src/autotests/BookMarkTest.cpp --- a/src/autotests/BookMarkTest.cpp +++ b/src/autotests/BookMarkTest.cpp @@ -45,16 +45,16 @@ QStringLiteral("command with pipe (|)"), QStringLiteral("ssh machine | tee -a /var/log/system.log"), QStringLiteral("file URL w/ non ASCII part"), QStringLiteral("file:///home/user/aκόσμε"), QStringLiteral("command with double quotes"), QStringLiteral("isql-fb -u sysdba -p example \"test\""), - QStringLiteral("command with single quotes"), QStringLiteral("isql-fb -u sysdba -p example 'test'") + QStringLiteral("command with single quotes"), QStringLiteral("isql-fb -u sysdba -p example 'test'"), + QStringLiteral("command with %"), QStringLiteral("date +%m-%d-%Y") }; QTest::addColumn("text"); QTest::addColumn("result"); for (int i = 0; i < groupUrlList.size(); ++i) { const auto& bm_url = groupUrlList.at(i); - // Current Konsole code using bm.url() - // The below is new to test decoding the url/command - auto bm = QUrl::fromPercentEncoding(bm_url.url().toUtf8()); + // Verify this line matching SessionControll.cpp to validate tests + auto bm = QUrl::fromPercentEncoding(bm_url.toEncoded()); QTest::newRow(bm_urls.at(i * 2).toUtf8().data())<< bm_urls.at((i * 2) +1) << bm; } }