Skip to content

Commit da52478

Browse files
committed
Fix MenuComplete to properly clear the menu
1 parent ae8a843 commit da52478

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

PSReadLine/Changes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Bug fixes:
1111
* Fix a bug where PowerShell events are not written to the console until PSReadline returns
1212
* Fixed so PowerTab now works with PSReadline
1313
* Highlight from history search is cleared before accepting a line now.
14+
* Fixed MenuComplete so it clears the menu (which only happened on some systems)
1415

1516
New functions:
1617
* NextLine

PSReadLine/Render.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ private static void WriteBufferLines(CHAR_INFO[] buffer, ref int top)
267267
Top = (short) top,
268268
Left = 0,
269269
Bottom = (short) bottom,
270-
Right = (short) bufferWidth
270+
Right = (short) (bufferWidth - 1)
271271
};
272272
NativeMethods.WriteConsoleOutput(handle, buffer,
273273
bufferSize, bufferCoord, ref writeRegion);
@@ -282,7 +282,7 @@ private static void WriteBufferLines(CHAR_INFO[] buffer, ref int top)
282282
private static void WriteBlankLines(int count, int top)
283283
{
284284
var blanks = new CHAR_INFO[count * Console.BufferWidth];
285-
for (int i = 0; i < count; i++)
285+
for (int i = 0; i < blanks.Length; i++)
286286
{
287287
blanks[i].BackgroundColor = Console.BackgroundColor;
288288
blanks[i].ForegroundColor = Console.ForegroundColor;

0 commit comments

Comments
 (0)