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

dynamic-ui doesn't scroll properly when it is done running #10005

Closed
asherf opened this issue Jun 8, 2020 · 1 comment · Fixed by #10234
Closed

dynamic-ui doesn't scroll properly when it is done running #10005

asherf opened this issue Jun 8, 2020 · 1 comment · Fixed by #10234
Assignees
Projects

Comments

@asherf
Copy link
Member

asherf commented Jun 8, 2020

this happens running in a terminal that is split horizontally, something like this:
Screen Shot 2020-06-08 at 3 26 48 PM

when pants finishes running, the scrolling is off, so I have to scroll up in order to see the results (of pytest in this case).

@stuhood
Copy link
Sponsor Member

stuhood commented Jun 8, 2020

I think that this could be fixed in the common case if we disabled the UI before rendering output from the @console_rule (perhaps by having the Console.write/print methods also explicitly call a "stop UI for the rest of the run" method), because then the output rendered by the @console_rule would write into the space where the UI was being rendered.

@stuhood stuhood added the ui label Jun 9, 2020
@gshuflin gshuflin self-assigned this Jun 9, 2020
@benjyw benjyw added this to To do in Pants 2.0 via automation Jun 16, 2020
@benjyw benjyw mentioned this issue Jun 16, 2020
4 tasks
@gshuflin gshuflin moved this from To do to In progress in Pants 2.0 Jun 30, 2020
Pants 2.0 automation moved this from In progress to Done Jul 7, 2020
gshuflin added a commit that referenced this issue Jul 7, 2020
### Problem

In some cases, most notably when pants prints the results of the `test` goal to stderr, we do this printing while the dynamic UI is still active. This means that when the dynamic UI is deactivated, the lines in the terminal corresponding to where the dynamic UI swimlanes were being animated vanish suddenly, which results in the terminal scrolling to some distance beyond where the last output was when a pants run is complete. This is undesirable. We'd like to be able to have a pants rule explicitly disable the dynamic UI when the rule knows it has no more work to do other than printing output.

### Solution

This commit exposes a method on the Python `Console` class `teardown_dynamic_ui()` that proxies to the extant `maybe_teardown_display` method, that will disable the dynamic UI for the remainder of the pants run.

### Result

Fixes #10005
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Pants 2.0
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants