Skip to content

Commit d7da9d3

Browse files
SteveL-MSFTlzybkr
authored andcommitted
Fix cursor position during menu complete (#809)
Fix #805
1 parent be23cc2 commit d7da9d3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

PSReadLine/Completion.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,17 +462,18 @@ public void DrawMenu(Menu previousMenu, bool menuSelect)
462462
{
463463
IConsole console = Singleton._console;
464464

465+
if (menuSelect)
466+
{
467+
console.CursorVisible = false;
468+
SaveCursor();
469+
}
470+
465471
// Move cursor to the start of the first line after our input.
466472
var bufferEndPoint = Singleton.ConvertOffsetToPoint(Singleton._buffer.Length);
467473
console.SetCursorPosition(bufferEndPoint.X, bufferEndPoint.Y);
468474
AdjustForPossibleScroll(1);
469475
MoveCursorDown(1);
470476
this.Top = bufferEndPoint.Y + 1;
471-
if (menuSelect)
472-
{
473-
console.CursorVisible = false;
474-
SaveCursor();
475-
}
476477

477478
var bufferWidth = console.BufferWidth;
478479
var columnWidth = this.ColumnWidth;

0 commit comments

Comments
 (0)