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

[BUG] Vertically aligned panel in live alternative screen stretches vertically over entire screen #1057

Closed
Dr-ZeeD opened this issue Feb 24, 2021 · 2 comments

Comments

@Dr-ZeeD
Copy link

Dr-ZeeD commented Feb 24, 2021

Describe the bug
When I try to vertically center a panel within the alternate screen mode of the live mode, it instead stretches over the entire screen with the text being aligned on top of the panel.

To Reproduce
Minimal code:

from time import sleep

from rich.align import Align
from rich.panel import Panel
from rich.live import Live
from rich import print

align = Align.center(
    Panel("Text", padding=(1, 2)),
    vertical="middle",
    height=20
)

with Live(align, screen=True):
    while True:
        sleep(0.4)

Platform
macOS 11 with iTerm2 Build 3.4.4

Diagnose
Command:

python -m rich.diagnose

Result:

╭────────────────── <class 'rich.console.Console'> ───────────────────╮
│ A high level console interface.                                     │
│                                                                     │
│ ╭─────────────────────────────────────────────────────────────────╮ │
│ │ <console width=71 ColorSystem.TRUECOLOR>                        │ │
│ ╰─────────────────────────────────────────────────────────────────╯ │
│                                                                     │
│     color_system = 'truecolor'                                      │
│         encoding = 'utf-8'                                          │
│             file = <_io.TextIOWrapper name='<stdout>' mode='w'      │
│                    encoding='utf-8'>                                │
│           height = 71                                               │
│ is_dumb_terminal = False                                            │
│   is_interactive = True                                             │
│       is_jupyter = False                                            │
│      is_terminal = True                                             │
│   legacy_windows = False                                            │
│         no_color = False                                            │
│          options = ConsoleOptions(size=ConsoleDimensions(width=71,  │
│                    height=71), legacy_windows=False, min_width=1,   │
│                    max_width=71, is_terminal=True,                  │
│                    encoding='utf-8', justify=None, overflow=None,   │
│                    no_wrap=False, highlight=None, height=None)      │
│            quiet = False                                            │
│           record = False                                            │
│         safe_box = True                                             │
│             size = ConsoleDimensions(width=71, height=71)           │
│        soft_wrap = False                                            │
│           stderr = False                                            │
│            style = None                                             │
│         tab_size = 8                                                │
│            width = 71                                               │
╰─────────────────────────────────────────────────────────────────────╯

Command:

python -m rich._windows

Result:

platform="Darwin"
WindowsConsoleFeatures(vt=False, truecolor=False)

Command:

pip freeze | grep rich

Result:

rich==9.11.1
@willmcgugan
Copy link
Collaborator

Please try 9.12.0

@Dr-ZeeD
Copy link
Author

Dr-ZeeD commented Feb 24, 2021

Now that's embarrassing 😅 works like a charm, thank you so much!

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

No branches or pull requests

2 participants