How can I disable text wrapping for text passed to a spinner? #3801
Replies: 2 comments
|
Your flags are lost because See spinner.py If you print the spinner yourself pass the options at print time console.print(spinner, no_wrap=True, overflow="ellipsis")Inside class NoWrap:
def __init__(self, renderable):
self.renderable = renderable
def __rich_console__(self, console, options):
yield from console.render(
self.renderable, options.update(no_wrap=True, overflow="ellipsis")
)
with Live(NoWrap(spinner), console=console):
...Works because Tested against current master |
|
The For a directly printed spinner, class NoWrap:
def __init__(self, renderable):
self.renderable = renderable
def __rich_console__(self, console, options):
yield from console.render(
self.renderable,
options.update(no_wrap=True, overflow="ellipsis"),
)Then render |
Uh oh!
There was an error while loading. Please reload this page.
I'm currently trying to display a potentially long command next to a spinner. The command text has been assembled with the options
overflow="ellipsis"andno_wrap=True, but when it is passed to aSpinnerit appears to wrap regardless.Notice how the
/tmp/marktenvymmjjwxappears on a new-line beneath the spinner.Is there a way I can accomplish this behaviour?
All reactions