Commit 8c9014bb authored by Matan Ziv-Av's avatar Matan Ziv-Av Committed by Kurt Hindenburg
Browse files

Add `DoNotMoveCursor` option to iterm2 inline image protocol

(cherry picked from commit 1341088b)
parent a2029280
Pipeline #151943 passed with stage
in 3 minutes and 24 seconds
......@@ -816,6 +816,7 @@ void Vt102Emulation::processSessionAttributeRequest(int tokenSize)
int keepAspect = 1;
int scaledWidth = 0;
int scaledHeight = 0;
bool moveCursor = true;
for (const auto &p : params) {
int eq = p.indexOf(QLatin1Char('='));
if (eq > 0) {
......@@ -831,6 +832,11 @@ void Vt102Emulation::processSessionAttributeRequest(int tokenSize)
keepAspect = 0;
}
}
if (var == QLatin1String("doNotMoveCursor")) {
if (val == QLatin1String("1")) {
moveCursor = false;
}
}
if (var == QLatin1String("width")) {
int unitPos = val.toStdString().find_first_not_of("0123456789");
scaledWidth = val.mid(0, unitPos).toInt();
......@@ -872,7 +878,7 @@ void Vt102Emulation::processSessionAttributeRequest(int tokenSize)
}
}
int rows = -1, cols = -1;
_currentScreen->addPlacement(pixmap, rows, cols);
_currentScreen->addPlacement(pixmap, rows, cols, true, moveCursor);
}
_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