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
If the displayed text is not "url-like", in PyCharm it will not be clickable. In Jupyter Lab it works fine.
When the displayed text is too long and breaks into two lines:
2.1. In PyCharm, the actual link address will contain only the first line which is incorrect.
2.2. In Jupyter Lab the actual link address is complete and correct, but when I hover over the link with mouse, only the current line will show an underscore, while I expected to see both lines of the link underscored. (This is a minor cosmetic issue.)
Code from rich import print url = "https://www.google.com/search?q=test" text_url = "https://www.google.com/search?q=test123" text_long = "https://www.google.com/search?q=test1aaaaaaaaaaaaaaaaaaaaaaaaaaaddddddddeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeefffffffffffffffffff" text = "aaaaaccccccc" print(f"My short link: [link={url}]{text_url}[/link]") print(f"My long link: [link={url}]{text_long}[/link]") print(f"My long link: [link={url}]{text}[/link]")
Output of the code
PyCharm output (for issue 1 and 2.1): link address contains only first line's content (https://www.google.com/search?q=test1aaaaaaaaaaaaaaaaaaaaaaaaaaaddddddddeeeeeee)
JupyterLab output (for issue 2.2): only the first line has underscore when I hover over the first line
Platform
Click to expand
What platform (Win/Linux/Mac) are you running on? What terminal software are you using?
rich version: 12.5.1
PyCharm version: 2022.2.2
OS: Window 11
For PyCharm I suspect that it doesn't support terminal links escape sequences, and it is merely making something that looks like a link clickable. You would get the same behaviour if you omitted [link] entirely.
The issue in Jupyter lab is probably incomplete support for terminal links.
Given that it works in a "real" terminal, it indicates that Rich is generating the correct output. You might want to report these to the maintainers of PyCharm and Jupyter lab.
Describe the bug
There are two visible issues:
2.1. In PyCharm, the actual link address will contain only the first line which is incorrect.
2.2. In Jupyter Lab the actual link address is complete and correct, but when I hover over the link with mouse, only the current line will show an underscore, while I expected to see both lines of the link underscored. (This is a minor cosmetic issue.)
Code
from rich import print
url = "https://www.google.com/search?q=test"
text_url = "https://www.google.com/search?q=test123"
text_long = "https://www.google.com/search?q=test1aaaaaaaaaaaaaaaaaaaaaaaaaaaddddddddeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeefffffffffffffffffff"
text = "aaaaaccccccc"
print(f"My short link: [link={url}]{text_url}[/link]")
print(f"My long link: [link={url}]{text_long}[/link]")
print(f"My long link: [link={url}]{text}[/link]")
Output of the code
PyCharm output (for issue 1 and 2.1): link address contains only first line's content (
https://www.google.com/search?q=test1aaaaaaaaaaaaaaaaaaaaaaaaaaaddddddddeeeeeee
)JupyterLab output (for issue 2.2): only the first line has underscore when I hover over the first line
Platform
Click to expand
What platform (Win/Linux/Mac) are you running on? What terminal software are you using?
rich version: 12.5.1
PyCharm version: 2022.2.2
OS: Window 11
┌────────────────────── <class 'rich.console.Console'> ───────────────────────┐
│ A high level console interface. │
│ │
│ ┌─────────────────────────────────────────────────────────────────────────┐ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────────────────┘ │
│ │
│ color_system = None │
│ encoding = 'utf-8' │
│ file = <_io.TextIOWrapper name='' mode='w' │
│ encoding='utf-8'> │
│ height = 25 │
│ is_alt_screen = False │
│ is_dumb_terminal = False │
│ is_interactive = False │
│ is_jupyter = False │
│ is_terminal = False │
│ legacy_windows = True │
│ no_color = False │
│ options = ConsoleOptions( │
│ size=ConsoleDimensions(width=79, height=25), │
│ legacy_windows=True, │
│ min_width=1, │
│ max_width=79, │
│ is_terminal=False, │
│ encoding='utf-8', │
│ max_height=25, │
│ justify=None, │
│ overflow=None, │
│ no_wrap=False, │
│ highlight=None, │
│ markup=None, │
│ height=None │
│ ) │
│ quiet = False │
│ record = False │
│ safe_box = True │
│ size = ConsoleDimensions(width=79, height=25) │
│ soft_wrap = False │
│ stderr = False │
│ style = None │
│ tab_size = 8 │
│ width = 79 │
└─────────────────────────────────────────────────────────────────────────────┘
┌─── <class 'rich._windows.WindowsConsoleFeatures'> ────┐
│ Windows features available. │
│ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ WindowsConsoleFeatures(vt=False, truecolor=False) │ │
│ └───────────────────────────────────────────────────┘ │
│ │
│ truecolor = False │
│ vt = False │
└───────────────────────────────────────────────────────┘
┌────── Environment Variables ───────┐
│ { │
│ 'TERM': None, │
│ 'COLORTERM': None, │
│ 'CLICOLOR': None, │
│ 'NO_COLOR': None, │
│ 'TERM_PROGRAM': None, │
│ 'COLUMNS': None, │
│ 'LINES': None, │
│ 'JUPYTER_COLUMNS': None, │
│ 'JUPYTER_LINES': None, │
│ 'JPY_PARENT_PID': None, │
│ 'VSCODE_VERBOSE_LOGGING': None │
│ } │
└────────────────────────────────────┘
platform="Windows"
Process finished with exit code 0
The text was updated successfully, but these errors were encountered: