mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
This fixes issue #6880 where user input interferes with the way the progress panel is displayed. If the user types any input while running a command displaying progress, that input would be echoed causing the terminal's cursor position to change. On the next progress write, output would be written using the new, incorrect cursor position. This had the effect of causing the progress pane to "march" across the screen if the user held down a key. The fix is fairly simple - update the physical cursor position right before updating the screen. This still leaves a very small window where an individual update might be off by a character or two but this is not cumulative and will be corrected on the next update. I've added code to SetBufferContents() to do this but only on UNIX. It's not a problem on non-VT100 style consoles.
This commit is contained in:
1 parent
4192463ce6
commit
5b90423e63
1 file changed
+8
-1
@@ -1741,7 +1741,6 @@ namespace Microsoft.PowerShell
|
||||
{
|
||||
PSTraceSource.NewArgumentNullException("contents");
|
||||
}
|
||||
|
||||
//if the cursor is on the last line, we need to make more space to print the specified buffer
|
||||
if (origin.Y == BufferSize.Height - 1 && origin.X >= BufferSize.Width)
|
||||
{
|
||||
@@ -1756,6 +1755,14 @@ namespace Microsoft.PowerShell
|
||||
}
|
||||
}
|
||||
|
||||
#if UNIX
|
||||
// Make sure that the physical cursor position matches where we think it is.
|
||||
// This is a problem on *nix, because input that the user types is echoed
|
||||
// and that moves the cursor. As a consequence, the cursor needs to be repositioned
|
||||
// before we update the screen.
|
||||
CursorPosition = origin;
|
||||
#endif
|
||||
|
||||
//iterate through the buffer to set
|
||||
foreach (var charitem in contents)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user