Commit 97feb543 authored by Ahmad Samir's avatar Ahmad Samir Committed by Kurt Hindenburg
Browse files

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
parent 13b2ed66
Pipeline #99530 passed with stage
in 1 minute and 50 seconds
......@@ -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<Enum::CursorShapeEnum>(numStr.toInt());
Q_EMIT setCursorStyleRequest(shape);
return;
}
}
_pendingSessionAttributesUpdates[attribute] = value;
_sessionAttributesUpdateTimer->start(20);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment