Terminal: Fix handling big chunks of OSC data

ShellIntegration previously ignored the initial and final flags of onOsc.

Change-Id: Ifa9594fba654cf543c117835fc182d4642dc70e4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-08-03 08:25:40 +02:00
parent 8ac9404725
commit ea14ada43b
2 changed files with 9 additions and 3 deletions

View File

@@ -79,10 +79,15 @@ bool ShellIntegration::canIntegrate(const Utils::CommandLine &cmdLine)
void ShellIntegration::onOsc(int cmd, std::string_view str, bool initial, bool final)
{
Q_UNUSED(initial);
Q_UNUSED(final);
if (initial)
m_oscBuffer.clear();
QString d = QString::fromLocal8Bit(str);
m_oscBuffer.append(str);
if (!final)
return;
QString d = QString::fromLocal8Bit(m_oscBuffer);
const auto [command, data] = Utils::splitAtFirst(d, ';');
if (cmd == 1337) {

View File

@@ -34,6 +34,7 @@ signals:
private:
QTemporaryDir m_tempDir;
QByteArray m_oscBuffer;
};
} // namespace Terminal