Skip to content

Conversation

BrucePay
Copy link
Collaborator

@BrucePay BrucePay commented Jun 1, 2018

PR Summary

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.

Manually verifying this is simple: run the repro script from the bug then hold down the space bar. If the Progress pane marches across the screen it's not fixed. If it stays (more or less) left-aligned then it's fixed.

PR Checklist

@@ -1741,7 +1741,7 @@ public override void ScrollBufferContents(Rectangle source, Coordinates destinat
{
PSTraceSource.NewArgumentNullException("contents");
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert the extra change.

Copy link

@anmenaga anmenaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iSazonov iSazonov merged commit 5b90423 into PowerShell:master Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants