diff --git a/src/host/getset.cpp b/src/host/getset.cpp index e9057d12693..0b3356242ca 100644 --- a/src/host/getset.cpp +++ b/src/host/getset.cpp @@ -719,6 +719,10 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont position.Y < 0)); // clang-format on + // MSFT: 15813316 - Try to use this SetCursorPosition call to inherit the cursor position. + auto& gci = ServiceLocator::LocateGlobals().getConsoleInformation(); + RETURN_IF_FAILED(gci.GetVtIo()->SetCursorPosition(position)); + RETURN_IF_NTSTATUS_FAILED(buffer.SetCursorPosition(position, true)); LOG_IF_FAILED(ConsoleImeResizeCompStrView()); diff --git a/src/terminal/adapter/InteractDispatch.cpp b/src/terminal/adapter/InteractDispatch.cpp index 6c205d3508b..8da0f121a54 100644 --- a/src/terminal/adapter/InteractDispatch.cpp +++ b/src/terminal/adapter/InteractDispatch.cpp @@ -150,15 +150,10 @@ bool InteractDispatch::MoveCursor(const VTInt row, const VTInt col) const auto coordCursorShort = til::unwrap_coord(coordCursor); - // MSFT: 15813316 - Try to use this MoveCursor call to inherit the cursor position. - auto& gci = ServiceLocator::LocateGlobals().getConsoleInformation(); - RETURN_IF_FAILED(gci.GetVtIo()->SetCursorPosition(coordCursorShort)); - // Finally, attempt to set the adjusted cursor position back into the console. - auto& cursor = _api.GetTextBuffer().GetCursor(); - cursor.SetPosition(coordCursorShort); - cursor.SetHasMoved(true); - return true; + const auto api = gsl::not_null{ ServiceLocator::LocateGlobals().api }; + auto& info = ServiceLocator::LocateGlobals().getConsoleInformation().GetActiveOutputBuffer(); + return SUCCEEDED(api->SetConsoleCursorPositionImpl(info, coordCursorShort)); } // Routine Description: