← pod_r5_v1i

rich_3944

failed CONTEXT UNSUBMITTED agent_error · 29 tool calls · 100 s · Textualize/rich

Task input

fix fonts

Fixes https://github.com/Textualize/rich/issues/3943

Tool calls (29)

#ToolArgumentsResult
1run_command
{
 "command": "grep -rn \"font\" . | head -20"
}
{"status": "ok", "stdout": "./CHANGELOG.md:175:- Ensure font is correctly inherited in exported HTML https://github.com/Textualize/rich/issues/3104\n./CHANGELOG
full
{"status": "ok", "stdout": "./CHANGELOG.md:175:- Ensure font is correctly inherited in exported HTML https://github.com/Textualize/rich/issues/3104\n./CHANGELOG.md:360:- Add `font_aspect_ratio` parameter in SVG export https://github.com/Textualize/rich/pull/2539/files\n./tests/test_console.py:518:    expected = '<!DOCTYPE html>\\n<html>\\n<head>\\n<meta charset=\"UTF-8\">\\n<style>\\n.r1 {font-weight: bold}\\n.r2 {color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold}\\n.r3 {color: #008000; text-decoration-color: #008000; font-weight: bold}\\nbody {\\n    color: #000000;\\n    background-color: #ffffff;\\n}\\n</style>\\n</head>\\n<body>\\n    <pre style=\"font-family:Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\"><code style=\"font-family:inherit\"><span class=\"r1\">foo &lt;</span><span class=\"r2\">script</span><span class=\"r1\">&gt; </span><span class=\"r3\">&#x27;test&#x27;</span><span class=\"r1\"> </span><a class=\"r1\" href=\"https://example.org\">Click</a>\\n</code></pre>\\n</body>\\n</html>\\n'\n./tests/test_console.py:527:    expected = '<!DOCTYPE html>\\n<html>\\n<head>\\n<meta charset=\"UTF-8\">\\n<style>\\n\\nbody {\\n    color: #000000;\\n    background-color: #ffffff;\\n}\\n</style>\\n</head>\\n<body>\\n    <pre style=\"font-family:Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\"><code style=\"font-family:inherit\"><span style=\"font-weight: bold\">foo </span><span style=\"font-weight: bold\"><a href=\"https://example.org\">Click</a></span>\\n</code></pre>\\n</body>\\n</html>\\n'\n./tests/test_console.py:531:EXPECTED_SVG = '<svg class=\"rich-terminal\" viewBox=\"0 0 1238 74.4\" xmlns=\"http://www.w3.org/2000/svg\">\\n    <!-- Generated with Rich https://www.textualize.io -->\\n    <style>\\n\\n    @font-face {\\n        font-family: \"Fira Code\";\\n        src: local(\"FiraCode-Regular\"),\\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Regular.woff2\") 
2run_command
{
 "command": "grep -rn \"font-family\" . | head -20"
}
{"status": "ok", "stdout": "./tests/test_console.py:518: expected = '<!DOCTYPE html>\\n<html>\\n<head>\\n<meta charset=\"UTF-8\">\\n<style>\\n.r1 {font-weight:
full
{"status": "ok", "stdout": "./tests/test_console.py:518:    expected = '<!DOCTYPE html>\\n<html>\\n<head>\\n<meta charset=\"UTF-8\">\\n<style>\\n.r1 {font-weight: bold}\\n.r2 {color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold}\\n.r3 {color: #008000; text-decoration-color: #008000; font-weight: bold}\\nbody {\\n    color: #000000;\\n    background-color: #ffffff;\\n}\\n</style>\\n</head>\\n<body>\\n    <pre style=\"font-family:Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\"><code style=\"font-family:inherit\"><span class=\"r1\">foo &lt;</span><span class=\"r2\">script</span><span class=\"r1\">&gt; </span><span class=\"r3\">&#x27;test&#x27;</span><span class=\"r1\"> </span><a class=\"r1\" href=\"https://example.org\">Click</a>\\n</code></pre>\\n</body>\\n</html>\\n'\n./tests/test_console.py:527:    expected = '<!DOCTYPE html>\\n<html>\\n<head>\\n<meta charset=\"UTF-8\">\\n<style>\\n\\nbody {\\n    color: #000000;\\n    background-color: #ffffff;\\n}\\n</style>\\n</head>\\n<body>\\n    <pre style=\"font-family:Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\"><code style=\"font-family:inherit\"><span style=\"font-weight: bold\">foo </span><span style=\"font-weight: bold\"><a href=\"https://example.org\">Click</a></span>\\n</code></pre>\\n</body>\\n</html>\\n'\n./tests/test_console.py:531:EXPECTED_SVG = '<svg class=\"rich-terminal\" viewBox=\"0 0 1238 74.4\" xmlns=\"http://www.w3.org/2000/svg\">\\n    <!-- Generated with Rich https://www.textualize.io -->\\n    <style>\\n\\n    @font-face {\\n        font-family: \"Fira Code\";\\n        src: local(\"FiraCode-Regular\"),\\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Regular.woff2\") format(\"woff2\"),\\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Regular.woff\") format(\"woff\");\\n        font-style: normal;\\n        font-weight: 400;\\n    }\\n    @font-face {\\n        fo
3run_command
{
 "command": "grep -rn \"font-family\" rich/ | head -20"
}
{"status": "ok", "stdout": "rich/_export_format.py:15: <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-f
full
{"status": "ok", "stdout": "rich/_export_format.py:15:    <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-family:inherit\">{code}</code></pre>\nrich/_export_format.py:26:        font-family: \"Fira Code\";\nrich/_export_format.py:34:        font-family: \"Fira Code\";\nrich/_export_format.py:43:        font-family: Fira Code, monospace;\nrich/_export_format.py:52:        font-family: arial;\nrich/jupyter.py:14:<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">{code}</pre>\n", "stderr": "", "exit_code": 0}
4run_command
{
 "command": "sed -n '1,60p' rich/_export_format.py"
}
{"status": "ok", "stdout": "CONSOLE_HTML_FORMAT = \"\"\"\\\n<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"UTF-8\">\n<style>\n{stylesheet}\nbody {{\n color: {
full
{"status": "ok", "stdout": "CONSOLE_HTML_FORMAT = \"\"\"\\\n<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"UTF-8\">\n<style>\n{stylesheet}\nbody {{\n    color: {foreground};\n    background-color: {background};\n}}\n</style>\n</head>\n<body>\n    <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-family:inherit\">{code}</code></pre>\n</body>\n</html>\n\"\"\"\n\nCONSOLE_SVG_FORMAT = \"\"\"\\\n<svg class=\"rich-terminal\" viewBox=\"0 0 {width} {height}\" xmlns=\"http://www.w3.org/2000/svg\">\n    <!-- Generated with Rich https://www.textualize.io -->\n    <style>\n\n    @font-face {{\n        font-family: \"Fira Code\";\n        src: local(\"FiraCode-Regular\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Regular.woff2\") format(\"woff2\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Regular.woff\") format(\"woff\");\n        font-style: normal;\n        font-weight: 400;\n    }}\n    @font-face {{\n        font-family: \"Fira Code\";\n        src: local(\"FiraCode-Bold\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Bold.woff2\") format(\"woff2\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Bold.woff\") format(\"woff\");\n        font-style: bold;\n        font-weight: 700;\n    }}\n\n    .{unique_id}-matrix {{\n        font-family: Fira Code, monospace;\n        font-size: {char_height}px;\n        line-height: {line_height}px;\n        font-variant-east-asian: full-width;\n    }}\n\n    .{unique_id}-title {{\n        font-size: 18px;\n        font-weight: bold;\n        font-family: arial;\n    }}\n\n    {styles}\n    </style>\n\n    <defs>\n    <clipPath id=\"{unique_id}-clip-terminal\">\n      <rect x=\"0\" y=\"0\" width=\"{terminal_width}\" height=\"{terminal_height}\" />\n", "stderr": "", "exit_code": 0}
5run_command
{
 "command": "sed -n '1,60p' rich/jupyter.py"
}
{"status": "ok", "stdout": "from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Sequence\n\nif TYPE_CHECKING:\n from rich.console import ConsoleRendera
full
{"status": "ok", "stdout": "from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Sequence\n\nif TYPE_CHECKING:\n    from rich.console import ConsoleRenderable\n\nfrom . import get_console\nfrom .segment import Segment\nfrom .terminal_theme import DEFAULT_TERMINAL_THEME\n\nif TYPE_CHECKING:\n    from rich.console import ConsoleRenderable\n\nJUPYTER_HTML_FORMAT = \"\"\"\\\n<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">{code}</pre>\n\"\"\"\n\n\nclass JupyterRenderable:\n    \"\"\"A shim to write html to Jupyter notebook.\"\"\"\n\n    def __init__(self, html: str, text: str) -> None:\n        self.html = html\n        self.text = text\n\n    def _repr_mimebundle_(\n        self, include: Sequence[str], exclude: Sequence[str], **kwargs: Any\n    ) -> Dict[str, str]:\n        data = {\"text/plain\": self.text, \"text/html\": self.html}\n        if include:\n            data = {k: v for (k, v) in data.items() if k in include}\n        if exclude:\n            data = {k: v for (k, v) in data.items() if k not in exclude}\n        return data\n\n\nclass JupyterMixin:\n    \"\"\"Add to an Rich renderable to make it render in Jupyter notebook.\"\"\"\n\n    __slots__ = ()\n\n    def _repr_mimebundle_(\n        self: \"ConsoleRenderable\",\n        include: Sequence[str],\n        exclude: Sequence[str],\n        **kwargs: Any,\n    ) -> Dict[str, str]:\n        console = get_console()\n        segments = list(console.render(self, console.options))\n        html = _render_segments(segments)\n        text = console._render_buffer(segments)\n        data = {\"text/plain\": text, \"text/html\": html}\n        if include:\n            data = {k: v for (k, v) in data.items() if k in include}\n        if exclude:\n            data = {k: v for (k, v) in data.items() if k not in exclude}\n        return data\n\n\ndef _render_segments(segments: Iterable[Segment]) -> str:\n    def escape(text:
6run_command
{
 "command": "grep -rn \"font-family:Menlo\" rich/ | head -20"
}
{"status": "ok", "stdout": "rich/_export_format.py:15: <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-f
full
{"status": "ok", "stdout": "rich/_export_format.py:15:    <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-family:inherit\">{code}</code></pre>\nrich/jupyter.py:14:<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">{code}</pre>\n", "stderr": "", "exit_code": 0}
7run_command
{
 "command": "grep -rn \"font-family: Fira Code\" rich/ | head -20"
}
{"status": "ok", "stdout": "rich/_export_format.py:43: font-family: Fira Code, monospace;\n", "stderr": "", "exit_code": 0}
full
{"status": "ok", "stdout": "rich/_export_format.py:43:        font-family: Fira Code, monospace;\n", "stderr": "", "exit_code": 0}
8run_command
{
 "command": "grep -n \"font-family: Fira Code\" rich/_export_format.py"
}
{"status": "ok", "stdout": "43: font-family: Fira Code, monospace;\n", "stderr": "", "exit_code": 0}
full
{"status": "ok", "stdout": "43:        font-family: Fira Code, monospace;\n", "stderr": "", "exit_code": 0}
9run_command
{
 "command": "grep -n \"font-family:Menlo\" rich/_export_format.py"
}
{"status": "ok", "stdout": "15: <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-family:inherit\">{code}<
full
{"status": "ok", "stdout": "15:    <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-family:inherit\">{code}</code></pre>\n", "stderr": "", "exit_code": 0}
10run_command
{
 "command": "grep -n \"font-family:Menlo\" rich/jupyter.py"
}
{"status": "ok", "stdout": "14:<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monos
full
{"status": "ok", "stdout": "14:<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">{code}</pre>\n", "stderr": "", "exit_code": 0}
11run_command
{
 "command": "python3 -m pytest tests/test_console.py -q -k \"export_html\""
}
{"status": "ok", "stdout": ".. [100%]\n2 passed, 97 deselected in 0.16s\n", "stderr": "", "exit_code": 0}
full
{"status": "ok", "stdout": "..                                                                       [100%]\n2 passed, 97 deselected in 0.16s\n", "stderr": "", "exit_code": 0}
12run_command
{
 "command": "python3 -m pytest tests/test_console.py -q -k \"export_svg\""
}
{"status": "ok", "stdout": ".. [100%]\n2 passed, 97 deselected in 0.16s\n", "stderr": "", "exit_code": 0}
full
{"status": "ok", "stdout": "..                                                                       [100%]\n2 passed, 97 deselected in 0.16s\n", "stderr": "", "exit_code": 0}
13run_command
{
 "command": "python3 -m pytest tests/test_console.py -q -k \"export\""
}
{"status": "ok", "stdout": "..... [100%]\n5 passed, 94 deselected in 0.16s\n", "stderr": "", "exit_code": 0}
full
{"status": "ok", "stdout": ".....                                                                    [100%]\n5 passed, 94 deselected in 0.16s\n", "stderr": "", "exit_code": 0}
14run_command
{
 "command": "python3 -c \"import rich; print(rich.__version__)\""
}
{"status": "error", "error_type": "CommandError", "error_message": "Traceback (most recent call last):\n File \"<string>\", line 1, in <module>\n import rich; p
full
{"status": "error", "error_type": "CommandError", "error_message": "Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n    import rich; print(rich.__version__)\n                       ^^^^^^^^^^^^^^^^\nAttributeError: module 'rich' has no attribute '__version__'\n", "details": {"stdout": "", "stderr": "Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n    import rich; print(rich.__version__)\n                       ^^^^^^^^^^^^^^^^\nAttributeError: module 'rich' has no attribute '__version__'\n", "exit_code": 1}}
15run_command
{
 "command": "ls -R rich/ | head -20"
}
{"status": "ok", "stdout": "__init__.py\n__main__.py\n_emoji_codes.py\n_emoji_replace.py\n_export_format.py\n_extension.py\n_fileno.py\n_inspect.py\n_log_render
full
{"status": "ok", "stdout": "__init__.py\n__main__.py\n_emoji_codes.py\n_emoji_replace.py\n_export_format.py\n_extension.py\n_fileno.py\n_inspect.py\n_log_render.py\n_loop.py\n_null_file.py\n_palettes.py\n_pick.py\n_ratio.py\n_spinners.py\n_stack.py\n_timer.py\n_unicode_data\n_win32_console.py\n_windows_renderer.py\n", "stderr": "", "exit_code": 0}
16run_command
{
 "command": "cat rich/__init__.py"
}
{"status": "ok", "stdout": "\"\"\"Rich text and beautiful formatting in the terminal.\"\"\"\n\nimport os\nfrom typing import IO, TYPE_CHECKING, Any, Callable, O
full
{"status": "ok", "stdout": "\"\"\"Rich text and beautiful formatting in the terminal.\"\"\"\n\nimport os\nfrom typing import IO, TYPE_CHECKING, Any, Callable, Optional, Union\n\nfrom ._extension import load_ipython_extension  # noqa: F401\n\n__all__ = [\"get_console\", \"reconfigure\", \"print\", \"inspect\", \"print_json\"]\n\nif TYPE_CHECKING:\n    from .console import Console\n\n# Global console used by alternative print\n_console: Optional[\"Console\"] = None\n\ntry:\n    _IMPORT_CWD = os.path.abspath(os.getcwd())\nexcept FileNotFoundError:\n    # Can happen if the cwd has been deleted\n    _IMPORT_CWD = \"\"\n\n\ndef get_console() -> \"Console\":\n    \"\"\"Get a global :class:`~rich.console.Console` instance. This function is used when Rich requires a Console,\n    and hasn't been explicitly given one.\n\n    Returns:\n        Console: A console instance.\n    \"\"\"\n    global _console\n    if _console is None:\n        from .console import Console\n\n        _console = Console()\n\n    return _console\n\n\ndef reconfigure(*args: Any, **kwargs: Any) -> None:\n    \"\"\"Reconfigures the global console by replacing it with another.\n\n    Args:\n        *args (Any): Positional arguments for the replacement :class:`~rich.console.Console`.\n        **kwargs (Any): Keyword arguments for the replacement :class:`~rich.console.Console`.\n    \"\"\"\n    from rich.console import Console\n\n    new_console = Console(*args, **kwargs)\n    _console = get_console()\n    _console.__dict__ = new_console.__dict__\n\n\ndef print(\n    *objects: Any,\n    sep: str = \" \",\n    end: str = \"\\n\",\n    file: Optional[IO[str]] = None,\n    flush: bool = False,\n) -> None:\n    r\"\"\"Print object(s) supplied via positional arguments.\n    This function has an identical signature to the built-in print.\n    For more advanced features, see the :class:`~rich.console.Console` class.\n\n    Args:\n        sep (str, optional): Separator between printed objects. Defaults to \" \".\n 
17run_command
{
 "command": "grep -rn \"font-family\" rich/ | head -20"
}
{"status": "ok", "stdout": "rich/_export_format.py:15: <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-f
full
{"status": "ok", "stdout": "rich/_export_format.py:15:    <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-family:inherit\">{code}</code></pre>\nrich/_export_format.py:26:        font-family: \"Fira Code\";\nrich/_export_format.py:34:        font-family: \"Fira Code\";\nrich/_export_format.py:43:        font-family: Fira Code, monospace;\nrich/_export_format.py:52:        font-family: arial;\nrich/jupyter.py:14:<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">{code}</pre>\n", "stderr": "", "exit_code": 0}
18run_command
{
 "command": "python3 - <<'PY'\nfrom rich.console import Console\nfrom rich.text import Text\n\nconsole = Console(record=True)\nconsole.print(\"Hello World\")\nhtml = console.export_html()\nprint(html)\nPY\n"
}
{"status": "ok", "stdout": "Hello World\n<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"UTF-8\">\n<style>\n\nbody {\n color: #000000;\n background-color: #fff
full
{"status": "ok", "stdout": "Hello World\n<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"UTF-8\">\n<style>\n\nbody {\n    color: #000000;\n    background-color: #ffffff;\n}\n</style>\n</head>\n<body>\n    <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-family:inherit\">Hello World\n</code></pre>\n</body>\n</html>\n\n", "stderr": "", "exit_code": 0}
19run_command
{
 "command": "python3 - <<'PY'\nfrom rich.console import Console\nfrom rich.text import Text\n\nconsole = Console(record=True)\nconsole.print(\"Hello World\")\nsvg = console.export_svg()\nprint(svg)\nPY\n"
}
{"status": "ok", "stdout": "Hello World\n<svg class=\"rich-terminal\" viewBox=\"0 0 994 74.4\" xmlns=\"http://www.w3.org/2000/svg\">\n <!-- Generated with Rich
full
{"status": "ok", "stdout": "Hello World\n<svg class=\"rich-terminal\" viewBox=\"0 0 994 74.4\" xmlns=\"http://www.w3.org/2000/svg\">\n    <!-- Generated with Rich https://www.textualize.io -->\n    <style>\n\n    @font-face {\n        font-family: \"Fira Code\";\n        src: local(\"FiraCode-Regular\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Regular.woff2\") format(\"woff2\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Regular.woff\") format(\"woff\");\n        font-style: normal;\n        font-weight: 400;\n    }\n    @font-face {\n        font-family: \"Fira Code\";\n        src: local(\"FiraCode-Bold\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Bold.woff2\") format(\"woff2\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Bold.woff\") format(\"woff\");\n        font-style: bold;\n        font-weight: 700;\n    }\n\n    .terminal-273878353-matrix {\n        font-family: Fira Code, monospace;\n        font-size: 20px;\n        line-height: 24.4px;\n        font-variant-east-asian: full-width;\n    }\n\n    .terminal-273878353-title {\n        font-size: 18px;\n        font-weight: bold;\n        font-family: arial;\n    }\n\n    .terminal-273878353-r1 { fill: #c5c8c6 }\n    </style>\n\n    <defs>\n    <clipPath id=\"terminal-273878353-clip-terminal\">\n      <rect x=\"0\" y=\"0\" width=\"975.0\" height=\"23.4\" />\n    </clipPath>\n    \n    </defs>\n\n    <rect fill=\"#292929\" stroke=\"rgba(255,255,255,0.35)\" stroke-width=\"1\" x=\"1\" y=\"1\" width=\"992\" height=\"72.4\" rx=\"8\"/><text class=\"terminal-273878353-title\" fill=\"#c5c8c6\" text-anchor=\"middle\" x=\"496\" y=\"27\">Rich</text>\n            <g transform=\"translate(26,22)\">\n            <circle cx=\"0\" cy=\"0\" r=\"7\" fill=\"#ff5f57\"/>\n            <circle cx=\"22\" cy=\"0\" r=\"7\" fill=\"#febc2e\"
20run_command
{
 "command": "grep -rn \"font-family:Menlo\" . | head -20"
}
{"status": "ok", "stdout": "./tests/test_console.py:518: expected = '<!DOCTYPE html>\\n<html>\\n<head>\\n<meta charset=\"UTF-8\">\\n<style>\\n.r1 {font-weight:
full
{"status": "ok", "stdout": "./tests/test_console.py:518:    expected = '<!DOCTYPE html>\\n<html>\\n<head>\\n<meta charset=\"UTF-8\">\\n<style>\\n.r1 {font-weight: bold}\\n.r2 {color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold}\\n.r3 {color: #008000; text-decoration-color: #008000; font-weight: bold}\\nbody {\\n    color: #000000;\\n    background-color: #ffffff;\\n}\\n</style>\\n</head>\\n<body>\\n    <pre style=\"font-family:Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\"><code style=\"font-family:inherit\"><span class=\"r1\">foo &lt;</span><span class=\"r2\">script</span><span class=\"r1\">&gt; </span><span class=\"r3\">&#x27;test&#x27;</span><span class=\"r1\"> </span><a class=\"r1\" href=\"https://example.org\">Click</a>\\n</code></pre>\\n</body>\\n</html>\\n'\n./tests/test_console.py:527:    expected = '<!DOCTYPE html>\\n<html>\\n<head>\\n<meta charset=\"UTF-8\">\\n<style>\\n\\nbody {\\n    color: #000000;\\n    background-color: #ffffff;\\n}\\n</style>\\n</head>\\n<body>\\n    <pre style=\"font-family:Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\"><code style=\"font-family:inherit\"><span style=\"font-weight: bold\">foo </span><span style=\"font-weight: bold\"><a href=\"https://example.org\">Click</a></span>\\n</code></pre>\\n</body>\\n</html>\\n'\n./tests/test_console.py:580:    expected = '<!DOCTYPE html>\\n<html>\\n<head>\\n<meta charset=\"UTF-8\">\\n<style>\\n\\nbody {\\n    color: #000000;\\n    background-color: #ffffff;\\n}\\n</style>\\n</head>\\n<body>\\n    <pre style=\"font-family:Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\"><code style=\"font-family:inherit\">foo\\n</code></pre>\\n</body>\\n</html>\\n'\n./docs/source/appendix/colors.rst:13:            <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2564
21run_command
{
 "command": "python3 - <<'PY'\nfrom rich.console import Console\nfrom rich.text import Text\n\nconsole = Console(record=True)\nconsole.print(\"Hello World\")\nhtml = console.export_html()\nprint(html)\nPY\n"
}
{"status": "ok", "stdout": "Hello World\n<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"UTF-8\">\n<style>\n\nbody {\n color: #000000;\n background-color: #fff
full
{"status": "ok", "stdout": "Hello World\n<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"UTF-8\">\n<style>\n\nbody {\n    color: #000000;\n    background-color: #ffffff;\n}\n</style>\n</head>\n<body>\n    <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-family:inherit\">Hello World\n</code></pre>\n</body>\n</html>\n\n", "stderr": "", "exit_code": 0}
22run_command
{
 "command": "grep -n \"font-family: Fira Code\" rich/_export_format.py"
}
{"status": "ok", "stdout": "43: font-family: Fira Code, monospace;\n", "stderr": "", "exit_code": 0}
full
{"status": "ok", "stdout": "43:        font-family: Fira Code, monospace;\n", "stderr": "", "exit_code": 0}
23run_command
{
 "command": "sed -n '40,50p' rich/_export_format.py"
}
{"status": "ok", "stdout": " }}\n\n .{unique_id}-matrix {{\n font-family: Fira Code, monospace;\n font-size: {char_height}px;\n line-height: {line_height}px;\n
full
{"status": "ok", "stdout": "    }}\n\n    .{unique_id}-matrix {{\n        font-family: Fira Code, monospace;\n        font-size: {char_height}px;\n        line-height: {line_height}px;\n        font-variant-east-asian: full-width;\n    }}\n\n    .{unique_id}-title {{\n        font-size: 18px;\n", "stderr": "", "exit_code": 0}
24run_command
{
 "command": "python3 - <<'PY'\nfrom rich.console import Console\nfrom rich.text import Text\n\nconsole = Console(record=True)\nconsole.print(\"Hello World\")\nsvg = console.export_svg()\nprint(svg)\nPY\n"
}
{"status": "ok", "stdout": "Hello World\n<svg class=\"rich-terminal\" viewBox=\"0 0 994 74.4\" xmlns=\"http://www.w3.org/2000/svg\">\n <!-- Generated with Rich
full
{"status": "ok", "stdout": "Hello World\n<svg class=\"rich-terminal\" viewBox=\"0 0 994 74.4\" xmlns=\"http://www.w3.org/2000/svg\">\n    <!-- Generated with Rich https://www.textualize.io -->\n    <style>\n\n    @font-face {\n        font-family: \"Fira Code\";\n        src: local(\"FiraCode-Regular\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Regular.woff2\") format(\"woff2\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Regular.woff\") format(\"woff\");\n        font-style: normal;\n        font-weight: 400;\n    }\n    @font-face {\n        font-family: \"Fira Code\";\n        src: local(\"FiraCode-Bold\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Bold.woff2\") format(\"woff2\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Bold.woff\") format(\"woff\");\n        font-style: bold;\n        font-weight: 700;\n    }\n\n    .terminal-273878353-matrix {\n        font-family: Fira Code, monospace;\n        font-size: 20px;\n        line-height: 24.4px;\n        font-variant-east-asian: full-width;\n    }\n\n    .terminal-273878353-title {\n        font-size: 18px;\n        font-weight: bold;\n        font-family: arial;\n    }\n\n    .terminal-273878353-r1 { fill: #c5c8c6 }\n    </style>\n\n    <defs>\n    <clipPath id=\"terminal-273878353-clip-terminal\">\n      <rect x=\"0\" y=\"0\" width=\"975.0\" height=\"23.4\" />\n    </clipPath>\n    \n    </defs>\n\n    <rect fill=\"#292929\" stroke=\"rgba(255,255,255,0.35)\" stroke-width=\"1\" x=\"1\" y=\"1\" width=\"992\" height=\"72.4\" rx=\"8\"/><text class=\"terminal-273878353-title\" fill=\"#c5c8c6\" text-anchor=\"middle\" x=\"496\" y=\"27\">Rich</text>\n            <g transform=\"translate(26,22)\">\n            <circle cx=\"0\" cy=\"0\" r=\"7\" fill=\"#ff5f57\"/>\n            <circle cx=\"22\" cy=\"0\" r=\"7\" fill=\"#febc2e\"
25run_command
{
 "command": "grep -rn \"font-family:Menlo\" . | head -20"
}
{"status": "ok", "stdout": "./tests/test_console.py:518: expected = '<!DOCTYPE html>\\n<html>\\n<head>\\n<meta charset=\"UTF-8\">\\n<style>\\n.r1 {font-weight:
full
{"status": "ok", "stdout": "./tests/test_console.py:518:    expected = '<!DOCTYPE html>\\n<html>\\n<head>\\n<meta charset=\"UTF-8\">\\n<style>\\n.r1 {font-weight: bold}\\n.r2 {color: #ff00ff; text-decoration-color: #ff00ff; font-weight: bold}\\n.r3 {color: #008000; text-decoration-color: #008000; font-weight: bold}\\nbody {\\n    color: #000000;\\n    background-color: #ffffff;\\n}\\n</style>\\n</head>\\n<body>\\n    <pre style=\"font-family:Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\"><code style=\"font-family:inherit\"><span class=\"r1\">foo &lt;</span><span class=\"r2\">script</span><span class=\"r1\">&gt; </span><span class=\"r3\">&#x27;test&#x27;</span><span class=\"r1\"> </span><a class=\"r1\" href=\"https://example.org\">Click</a>\\n</code></pre>\\n</body>\\n</html>\\n'\n./tests/test_console.py:527:    expected = '<!DOCTYPE html>\\n<html>\\n<head>\\n<meta charset=\"UTF-8\">\\n<style>\\n\\nbody {\\n    color: #000000;\\n    background-color: #ffffff;\\n}\\n</style>\\n</head>\\n<body>\\n    <pre style=\"font-family:Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\"><code style=\"font-family:inherit\"><span style=\"font-weight: bold\">foo </span><span style=\"font-weight: bold\"><a href=\"https://example.org\">Click</a></span>\\n</code></pre>\\n</body>\\n</html>\\n'\n./tests/test_console.py:580:    expected = '<!DOCTYPE html>\\n<html>\\n<head>\\n<meta charset=\"UTF-8\">\\n<style>\\n\\nbody {\\n    color: #000000;\\n    background-color: #ffffff;\\n}\\n</style>\\n</head>\\n<body>\\n    <pre style=\"font-family:Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\"><code style=\"font-family:inherit\">foo\\n</code></pre>\\n</body>\\n</html>\\n'\n./docs/source/appendix/colors.rst:13:            <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2564\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2564
26run_command
{
 "command": "python3 - <<'PY'\nfrom rich.console import Console\nfrom rich.text import Text\n\nconsole = Console(record=True)\nconsole.print(\"Hello World\")\nhtml = console.export_html()\nprint(html)\nPY\n"
}
{"status": "ok", "stdout": "Hello World\n<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"UTF-8\">\n<style>\n\nbody {\n color: #000000;\n background-color: #fff
full
{"status": "ok", "stdout": "Hello World\n<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"UTF-8\">\n<style>\n\nbody {\n    color: #000000;\n    background-color: #ffffff;\n}\n</style>\n</head>\n<body>\n    <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-family:inherit\">Hello World\n</code></pre>\n</body>\n</html>\n\n", "stderr": "", "exit_code": 0}
27run_command
{
 "command": "python3 - <<'PY'\nfrom rich.console import Console\nfrom rich.text import Text\n\nconsole = Console(record=True)\nconsole.print(\"Hello World\")\nsvg = console.export_svg()\nprint(svg)\nPY\n"
}
{"status": "ok", "stdout": "Hello World\n<svg class=\"rich-terminal\" viewBox=\"0 0 994 74.4\" xmlns=\"http://www.w3.org/2000/svg\">\n <!-- Generated with Rich
full
{"status": "ok", "stdout": "Hello World\n<svg class=\"rich-terminal\" viewBox=\"0 0 994 74.4\" xmlns=\"http://www.w3.org/2000/svg\">\n    <!-- Generated with Rich https://www.textualize.io -->\n    <style>\n\n    @font-face {\n        font-family: \"Fira Code\";\n        src: local(\"FiraCode-Regular\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Regular.woff2\") format(\"woff2\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Regular.woff\") format(\"woff\");\n        font-style: normal;\n        font-weight: 400;\n    }\n    @font-face {\n        font-family: \"Fira Code\";\n        src: local(\"FiraCode-Bold\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Bold.woff2\") format(\"woff2\"),\n                url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Bold.woff\") format(\"woff\");\n        font-style: bold;\n        font-weight: 700;\n    }\n\n    .terminal-273878353-matrix {\n        font-family: Fira Code, monospace;\n        font-size: 20px;\n        line-height: 24.4px;\n        font-variant-east-asian: full-width;\n    }\n\n    .terminal-273878353-title {\n        font-size: 18px;\n        font-weight: bold;\n        font-family: arial;\n    }\n\n    .terminal-273878353-r1 { fill: #c5c8c6 }\n    </style>\n\n    <defs>\n    <clipPath id=\"terminal-273878353-clip-terminal\">\n      <rect x=\"0\" y=\"0\" width=\"975.0\" height=\"23.4\" />\n    </clipPath>\n    \n    </defs>\n\n    <rect fill=\"#292929\" stroke=\"rgba(255,255,255,0.35)\" stroke-width=\"1\" x=\"1\" y=\"1\" width=\"992\" height=\"72.4\" rx=\"8\"/><text class=\"terminal-273878353-title\" fill=\"#c5c8c6\" text-anchor=\"middle\" x=\"496\" y=\"27\">Rich</text>\n            <g transform=\"translate(26,22)\">\n            <circle cx=\"0\" cy=\"0\" r=\"7\" fill=\"#ff5f57\"/>\n            <circle cx=\"22\" cy=\"0\" r=\"7\" fill=\"#febc2e\"
28run_command
{
 "command": "cd /workspace && python3 - <<'PY'\nfrom pathlib import Path\np = Path(\"rich/_export_format.py\")\ns = p.read_text()\nold = \"    <pre style=\\\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\\\"><code style=\\\"font-family:inherit\\\">{code}</code></pre>\"\nnew = \"    <pre style=\\\"font-family:Fira Code, Menlo, 'DejaVu Sans Mono', consolas, 'Courier New', monospace\\\"><code style=\\\"font-family:inherit\\\">{code}</code></pre>\"\nassert s.count(old) == 1, (\"old text found this many times:\", s.count(old))\nt = s.replace(old, new)\np.write_text(t)\nPY\n"
}
{"status": "ok", "stdout": "", "stderr": "", "exit_code": 0}
full
{"status": "ok", "stdout": "", "stderr": "", "exit_code": 0}
29run_command
{
 "command": "cd /workspace && python3 - <<'PY'\nfrom pathlib import Path\np = Path(\"rich/jupyter.py\")\ns = p.read_text()\nold = '<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\">{code}</pre>'\nnew = '<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Fira Code, Menlo, \\'DejaVu Sans Mono\\', consolas, \\'Courier New\\', monospace\">{code}</pre>'\nassert s.count(old) == 1, (\"old text found this many times:\", s.count(old))\nt = s.replace(old, new)\np.write_text(t)\nPY\n"
}
{"status": "ok", "stdout": "", "stderr": "", "exit_code": 0}
full
{"status": "ok", "stdout": "", "stderr": "", "exit_code": 0}

Patch

diff --git a/rich/_export_format.py b/rich/_export_format.py
index e7527e52..2af65f29 100644
--- a/rich/_export_format.py
+++ b/rich/_export_format.py
@@ -12,7 +12,7 @@ body {{
 </style>
 </head>
 <body>
-    <pre style="font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace"><code style="font-family:inherit">{code}</code></pre>
+    <pre style="font-family:Fira Code, Menlo, 'DejaVu Sans Mono', consolas, 'Courier New', monospace"><code style="font-family:inherit">{code}</code></pre>
 </body>
 </html>
 """
diff --git a/rich/jupyter.py b/rich/jupyter.py
index 24135a9f..197311ef 100644
--- a/rich/jupyter.py
+++ b/rich/jupyter.py
@@ -11,7 +11,7 @@ if TYPE_CHECKING:
     from rich.console import ConsoleRenderable
 
 JUPYTER_HTML_FORMAT = """\
-<pre style="white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace">{code}</pre>
+<pre style="white-space:pre;overflow-x:auto;line-height:normal;font-family:Fira Code, Menlo, 'DejaVu Sans Mono', consolas, 'Courier New', monospace">{code}</pre>
 """
 
 

Test output

show
.....................................................F
=================================== FAILURES ===================================
________________________________ test_nerd_font ________________________________

    def test_nerd_font():
        """Regression test for https://github.com/Textualize/rich/issues/3943"""
        # Not allocated by unicode, but used by nerd fonts
>       assert cell_len("\U000f024d") == 1
E       AssertionError: assert 0 == 1
E        +  where 0 = cell_len('\U000f024d')

tests/test_cells.py:189: AssertionError
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
1 failed, 53 passed in 0.05s