-
Notifications
You must be signed in to change notification settings - Fork 16
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
printer: enhance ephemeral message handover after stop() or pause() #126
printer: enhance ephemeral message handover after stop() or pause() #126
Conversation
27cdff6
to
652447a
Compare
652447a
to
1e787dc
Compare
It is a very common pattern for craft tools to start the session directly on a host machine, but launch another craft instance to do the actual work inside LXD or Multipass. In order for a seamless CLI experience (which looks identical between a 'destructive build' on the host, LXD or Multipass), we need support for progress messages (ephemeral=True) to seamlessly cross the boundaries between the host and the container instance of of the craft tool. Please see examples.py canonical#26 for an example. Add support for _Printer to respect ephemeral messages when stopping. On printer stop(), these messages are no longer terminated with a newline, but instead the printer will clear and reset the cursor to the start of the line. This behaviour change will allow subsequent terminal writes by a different process the ability to reuse a terminal line previously used as ephemeral output.
1e787dc
to
9f9df27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for this! Annotated a couple of details for improvement. Thanks again!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful, thanks for this work!!!
@flotter note that some tests are failing... |
0f5da8d
to
5397749
Compare
5397749
to
146b966
Compare
It is a very common pattern for craft tools to start the session
directly on a host machine, but launch another craft instance to
do the actual work inside LXD or Multipass.
In order for a seamless CLI experience (which looks identical
between a 'destructive build' on the host, LXD or Multipass),
we need support for progress messages (ephemeral=True) to seamlessly
cross the boundaries between the host and the container instance of
of the craft tool.
Please see examples.py #26 for an example.
Add support for _Printer to respect ephemeral messages when
stopping. On printer stop(), these messages are no longer terminated
with a newline, but instead the printer will clear and reset the
cursor to the start of the line.
This behaviour change will allow subsequent terminal writes by a
different process the ability to reuse a terminal line previously
used as ephemeral output.