Use setCursorBufferPosition() first to collapse cursors.