Commit 23007bb9 authored by Luis Javier Merino's avatar Luis Javier Merino
Browse files

CPR should take DECOM into account

Cursor Position Report should return coordinates relative to the top
margin if DEC Origin Mode is set.

From esctest:
parent 717b615a
......@@ -1110,7 +1110,12 @@ void Vt102Emulation::sendString(const QByteArray &s)
void Vt102Emulation::reportCursorPosition()
char tmp[30];
snprintf(tmp, sizeof(tmp), "\033[%d;%dR", _currentScreen->getCursorY() + 1, _currentScreen->getCursorX() + 1);
int y = _currentScreen->getCursorY() + 1;
int x = _currentScreen->getCursorX() + 1;
if (_currentScreen->getMode(MODE_Origin)) {
y -= _currentScreen->topMargin();
snprintf(tmp, sizeof(tmp), "\033[%d;%dR", y, x);
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