Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #6880 Progress panel displays incorrectly on UNIX when the user is typing. #6972

Merged
merged 3 commits into from
Jun 7, 2018

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
Contributor

@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