From 97feb543975f7ae2ed2ab2b90ce9bdd348e10bed Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Thu, 18 Nov 2021 11:13:33 +0200 Subject: [PATCH] Handle changing cursor shape property without creating a new profile Using an escape sequence, e.g. printf '\e]50;CursorShape=1\a', to change the cursor shape property like we handle DECSCUSR, i.e. as a transient change without creating a new profile (see SessionManager::sessionProfileCommandReceived()). To test: - printf '\e]50;CursorShape=1\a' to change the cursor shape, check that the current profile hasn't been switched to a new profile (that has no name as it's a temp profile) BUG: 445590 FIXED-IN: 21.12 --- src/Vt102Emulation.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Vt102Emulation.cpp b/src/Vt102Emulation.cpp index b090eadda..665e62217 100644 --- a/src/Vt102Emulation.cpp +++ b/src/Vt102Emulation.cpp @@ -544,6 +544,19 @@ void Vt102Emulation::processSessionAttributeRequest(int tokenSize) return; } + if (attribute == Session::ProfileChange) { + if (value.startsWith(QLatin1String("CursorShape="))) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + const auto numStr = QStringView(value).right(1); +#else + const auto numStr = value.rightRef(1); +#endif + const Enum::CursorShapeEnum shape = static_cast(numStr.toInt()); + Q_EMIT setCursorStyleRequest(shape); + return; + } + } + _pendingSessionAttributesUpdates[attribute] = value; _sessionAttributesUpdateTimer->start(20); }