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

Bugfix: CLS should clear current active buffer #2729

Merged
merged 2 commits into from
Sep 13, 2019

Conversation

carlos-zamora
Copy link
Member

@carlos-zamora carlos-zamora commented Sep 11, 2019

Summary of the Pull Request

CLS calls two functions:

  • SetConsoleCursorPositionImpl()
  • ScrollConsoleScreenBufferWImpl()
    Both of these were not checking which buffer to apply to (main vs active buffer).

Now we get the active buffer and apply the changes to that one.

Also, we forgot to switch out of the alt buffer in the previous test. Added that in.

PR Checklist

Validation Steps Performed

manually performed what is described in the attached bug report.

Also ran automated test.

@carlos-zamora carlos-zamora self-assigned this Sep 11, 2019
src/host/getset.cpp Outdated Show resolved Hide resolved
Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

approving contingent upon changing that one line

src/host/getset.cpp Outdated Show resolved Hide resolved
@miniksa
Copy link
Member

miniksa commented Sep 12, 2019

Is this indicative of a larger problem? Should we file an outstanding work item to audit all sites of manipulating the active buffer and/or somehow change the design such that the methods cannot accidentally be called without resolving which one is the active one first?

@miniksa
Copy link
Member

miniksa commented Sep 12, 2019

Is this indicative of a larger problem? Should we file an outstanding work item to audit all sites of manipulating the active buffer and/or somehow change the design such that the methods cannot accidentally be called without resolving which one is the active one first?

For the latter, my proposal would be to hide all the verbage methods off the base class and implement some sort of interface that holds them that is only returned when/if someone has correctly queried for the active one first. I'd accept competing proposals, though.

@DHowett-MSFT DHowett-MSFT merged commit 3d35e39 into master Sep 13, 2019
@DHowett-MSFT DHowett-MSFT deleted the dev/cazamor/bugfix-clear-altbuffer branch September 13, 2019 21:36
DHowett-MSFT pushed a commit that referenced this pull request Sep 23, 2019
CLS calls two functions:
- `SetConsoleCursorPositionImpl()`
- `ScrollConsoleScreenBufferWImpl()`
Both of these were not checking which buffer to apply to (main vs active buffer).

Now we get the active buffer and apply the changes to that one.

Also, we forgot to switch out of the alt buffer in the previous test. Added that in.

Closes #1189.

(cherry picked from commit 3d35e39)
@ghost
Copy link

ghost commented Sep 24, 2019

🎉Windows Terminal Preview v0.5.2661.0 has been released which incorporates this pull request.:tada:

Handy links:

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.

CLS doesn't work in the VT alternate buffer
4 participants