We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
from rich.traceback import install install() raise RuntimeError("\x1b[31mFoo")
produces:
❯ py tmp6.py ╭───────────────────── Traceback (most recent call last) ─────────────────────╮ │ file.py:4 in <module> │ │ │ │ 1 from rich.traceback import install │ │ 2 install() │ │ 3 │ │ ❱ 4 raise RuntimeError("\x1b[31mFoo") │ │ 5 │ │ 6 │ ╰─────────────────────────────────────────────────────────────────────────────╯ RuntimeError: [31mFoo
Expected behaviour is for for either (a) the \x1b[31m escape code to be respected, or (b) at minimum for the escape codes to be removed and ignored.
\x1b[31m
Rich version 13.8.1 on Linux.
❯ python -m rich.diagnose ╭────────────────────── <class 'rich.console.Console'> ───────────────────────╮ │ A high level console interface. │ │ │ │ ╭─────────────────────────────────────────────────────────────────────────╮ │ │ │ <console width=79 ColorSystem.TRUECOLOR> │ │ │ ╰─────────────────────────────────────────────────────────────────────────╯ │ │ │ │ color_system = 'truecolor' │ │ encoding = 'utf-8' │ │ file = <_io.TextIOWrapper name='<stdout>' mode='w' │ │ encoding='utf-8'> │ │ height = 45 │ │ is_alt_screen = False │ │ is_dumb_terminal = False │ │ is_interactive = True │ │ is_jupyter = False │ │ is_terminal = True │ │ legacy_windows = False │ │ no_color = False │ │ options = ConsoleOptions( │ │ size=ConsoleDimensions(width=79, height=45), │ │ legacy_windows=False, │ │ min_width=1, │ │ max_width=79, │ │ is_terminal=True, │ │ encoding='utf-8', │ │ max_height=45, │ │ 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=45) │ │ 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': 'tmux-256color', │ │ 'COLORTERM': 'truecolor', │ │ 'CLICOLOR': None, │ │ 'NO_COLOR': None, │ │ 'TERM_PROGRAM': 'tmux', │ │ 'COLUMNS': None, │ │ 'LINES': None, │ │ 'JUPYTER_COLUMNS': None, │ │ 'JUPYTER_LINES': None, │ │ 'JPY_PARENT_PID': None, │ │ 'VSCODE_VERBOSE_LOGGING': None │ │ } │ ╰────────────────────────────────────╯ platform="Darwin"
The text was updated successfully, but these errors were encountered:
We found the following entries in the FAQ which you may find helpful:
Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.
This is an automated reply, generated by FAQtory
Sorry, something went wrong.
Rich will generate escape sequences, but not parse them by default.
ANSI escape sequences in exceptions are a bad idea, because you never know what is going to consume them.
I hope we solved your problem.
If you like using Rich, you might also enjoy Textual
No branches or pull requests
Describe the bug
produces:
Expected behaviour is for for either (a) the
\x1b[31m
escape code to be respected, or (b) at minimum for the escape codes to be removed and ignored.Rich version 13.8.1 on Linux.
The text was updated successfully, but these errors were encountered: