Commit 1341088b authored by Matan Ziv-Av's avatar Matan Ziv-Av
Browse files

Add `DoNotMoveCursor` option to iterm2 inline image protocol

parent 67099363
Pipeline #151942 passed with stage
in 4 minutes and 7 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);
......
Supports Markdown
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