You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Question:
Can I live render only a portion of a line without overwriting existing text?
Background:
I am developing a wrapper around a third-party application and would like to use a Spinner. I have used console.status in the past so I started there:
Unfortunately, the third-party command is multi-threaded, and moderately resource heavy, so the the entire line ●∙∙ Searching flickers. I didn't think it was a big deal, but some users complained that the flickering text was distracting. I tried to confine the flickering to just the Spinner by naively moving it to the end of the line:
However, as mentioned in #1314, this does not solve the problem because Live redraws the entire renderable on each update, so the flickering text persisted. I then tried to move the text out of the Live context:
However, while this initially prints Searching on the line, it is immediately overwritten by the spinning ●∙∙. Is there any way to place the live rendered spinner on the same line as static text?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
Question:
Can I live render only a portion of a line without overwriting existing text?
Background:
I am developing a wrapper around a third-party application and would like to use a
Spinner
. I have usedconsole.status
in the past so I started there:Unfortunately, the third-party command is multi-threaded, and moderately resource heavy, so the the entire line
●∙∙ Searching
flickers. I didn't think it was a big deal, but some users complained that the flickering text was distracting. I tried to confine the flickering to just theSpinner
by naively moving it to the end of the line:However, as mentioned in #1314, this does not solve the problem because
Live
redraws the entire renderable on each update, so the flickering text persisted. I then tried to move the text out of theLive
context:However, while this initially prints
Searching
on the line, it is immediately overwritten by the spinning●∙∙
. Is there any way to place the live rendered spinner on the same line as static text?Thanks for reading this far!
Chuck
Beta Was this translation helpful? Give feedback.
All reactions