From 17c9c6dbb3c0347c37a0f0928cafa05493593ad4 Mon Sep 17 00:00:00 2001 From: bugale Date: Fri, 13 Dec 2019 00:32:17 +0200 Subject: [PATCH] Using the Y viewport for setting cursor correctly (#368) [shellhost] - fix cursor position, Y viewport. --- contrib/win32/win32compat/shell-host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/win32/win32compat/shell-host.c b/contrib/win32/win32compat/shell-host.c index d6b5ff0f1..d044a4dcd 100644 --- a/contrib/win32/win32compat/shell-host.c +++ b/contrib/win32/win32compat/shell-host.c @@ -591,7 +591,7 @@ SendSetCursor(HANDLE hInput, int X, int Y) int out = 0; char formatted_output[255]; - out = _snprintf_s(formatted_output, sizeof(formatted_output), _TRUNCATE, "\033[%d;%dH", Y, X); + out = _snprintf_s(formatted_output, sizeof(formatted_output), _TRUNCATE, "\033[%d;%dH", Y - ViewPortY, X); if (out > 0 && bUseAnsiEmulation) WriteFile(hInput, formatted_output, out, &wr, NULL); }