failed WRONG_FIX wrong_fix · 24 tool calls · 122 s · Textualize/rich
fix fonts Fixes https://github.com/Textualize/rich/issues/3943
| # | Tool | Arguments | Result |
|---|---|---|---|
| 1 | run_command | {
"command": "grep -rn \"font\" rich | head -20"
} | {"status": "ok", "stdout": "rich/console.py:2336: font_aspect_ratio: float = 0.61,\nrich/console.py:2349: font_aspect_ratio (float, optional): The width to heigfull{"status": "ok", "stdout": "rich/console.py:2336: font_aspect_ratio: float = 0.61,\nrich/console.py:2349: font_aspect_ratio (float, optional): The width to height ratio of the font used in the ``code_format``\nrich/console.py:2350: string. Defaults to 0.61, which is the width to height ratio of Fira Code (the default font).\nrich/console.py:2351: If you aren't specifying a different font inside ``code_format``, you probably don't need this.\nrich/console.py:2381: css_rules.append(\"font-weight: bold\")\nrich/console.py:2383: css_rules.append(\"font-style: italic;\")\nrich/console.py:2397: char_width = char_height * font_aspect_ratio\nrich/console.py:2588: font_aspect_ratio: float = 0.61,\nrich/console.py:2601: font_aspect_ratio (float, optional): The width to height ratio of the font used in the ``code_format``\nrich/console.py:2602: string. Defaults to 0.61, which is the width to height ratio of Fira Code (the default font).\nrich/console.py:2603: If you aren't specifying a different font inside ``code_format``, you probably don't need this.\nrich/console.py:2612: font_aspect_ratio=font_aspect_ratio,\nrich/box.py:404:# Map Boxes that don't render with raster fonts on to equivalent that do\nrich/style.py:585: append(\"font-weight: bold\")\nrich/style.py:587: append(\"font-style: italic\")\nrich/table.py:48: safe_box (Optional[bool], optional): Disable box characters that don't display on windows legacy terminal with *raster* fonts. Defaults to True.\nrich/table.py:163: safe_box (Optional[bool], optional): Disable box characters that don't display on windows legacy terminal with *raster* fonts. Defaults to True.\nrich/_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/_ex |
| 2 | run_command | {
"command": "grep -n \"font-family\" 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>\n26: font-family: \"Fira Code\";\n34: font-family: \"Fira Code\";\n43: font-family: Fira Code, monospace;\n52: font-family: arial;\n", "stderr": "", "exit_code": 0} |
| 3 | run_command | {
"command": "sed -n '10,60p' rich/_export_format.py"
} | {"status": "ok", "stdout": " background-color: {background};\n}}\n</style>\n</head>\n<body>\n <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Couriefull{"status": "ok", "stdout": " 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} |
| 4 | run_command | {
"command": "grep -n \"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} |
| 5 | run_command | {
"command": "sed -n '1,20p' 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", "stderr": "", "exit_code": 0} |
| 6 | run_command | {
"command": "run_command: grep -rn \"Fira Code\" rich/_export_format.py"
} | {"status": "error", "error_type": "CommandError", "error_message": "/bin/bash: run_command:: command not found\n", "details": {"stdout": "", "stderr": "/bin/basfull{"status": "error", "error_type": "CommandError", "error_message": "/bin/bash: run_command:: command not found\n", "details": {"stdout": "", "stderr": "/bin/bash: run_command:: command not found\n", "exit_code": 127}} |
| 7 | run_command | {
"command": "grep -rn \"Fira Code\" rich/_export_format.py"
} | {"status": "ok", "stdout": "rich/_export_format.py:26: font-family: \"Fira Code\";\nrich/_export_format.py:34: font-family: \"Fira Code\";\nrich/_export_format.full{"status": "ok", "stdout": "rich/_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:75:_SVG_FONT_FAMILY = \"Rich Fira Code\"\n", "stderr": "", "exit_code": 0} |
| 8 | run_command | {
"command": "sed -n '1,15p' 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", "stderr": "", "exit_code": 0} |
| 9 | run_command | {
"command": "cd /workspace && python3 - <<'PY'\nfrom pathlib import Path\np = Path(\"rich/_export_format.py\"); s = p.read_text()\nold = '<pre style=\\\\\"font-family:Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\\\\\">'\nnew = '<pre style=\\\\\"font-family:\\'Fira Code\\',Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\\\\\"'\n# Wait, let me check the original string carefully.\n# 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>\n# The string is inside a triple quoted string with backslashes.\nPY\n"
} | {"status": "ok", "stdout": "", "stderr": "", "exit_code": 0}full{"status": "ok", "stdout": "", "stderr": "", "exit_code": 0} |
| 10 | run_command | {
"command": "sed -n '10,20p' rich/_export_format.py"
} | {"status": "ok", "stdout": " background-color: {background};\n}}\n</style>\n</head>\n<body>\n <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Couriefull{"status": "ok", "stdout": " 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", "stderr": "", "exit_code": 0} |
| 11 | run_command | {
"command": "cd /workspace && python3 - <<'PY'\nfrom pathlib import Path\np = Path(\"rich/_export_format.py\"); s = p.read_text()\nold = ' <pre style=\\\\\"font-family:Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\\\\\">'\nnew = ' <pre style=\\\\\"font-family:\\'Fira Code\\',Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\\\\\"'\nassert s.count(old) == 1, (\"old text found this many times:\", s.count(old))\nt = s.replace(old, new); p.write_text(t)\nPY\n"
} | {"status": "error", "error_type": "CommandError", "error_message": "Traceback (most recent call last):\n File \"<stdin>\", line 5, in <module>\nAssertionError: full{"status": "error", "error_type": "CommandError", "error_message": "Traceback (most recent call last):\n File \"<stdin>\", line 5, in <module>\nAssertionError: ('old text found this many times:', 0)\n", "details": {"stdout": "", "stderr": "Traceback (most recent call last):\n File \"<stdin>\", line 5, in <module>\nAssertionError: ('old text found this many times:', 0)\n", "exit_code": 1}} |
| 12 | run_command | {
"command": "cat -A rich/_export_format.py | sed -n '10,20p'"
} | {"status": "ok", "stdout": "", "stderr": "cat: illegal option -- A\nusage: cat [-belnstuv] [file ...]\n", "exit_code": 0}full{"status": "ok", "stdout": "", "stderr": "cat: illegal option -- A\nusage: cat [-belnstuv] [file ...]\n", "exit_code": 0} |
| 13 | run_command | {
"command": "cat -v rich/_export_format.py | sed -n '10,20p'"
} | {"status": "ok", "stdout": " background-color: {background};\n}}\n</style>\n</head>\n<body>\n <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Couriefull{"status": "ok", "stdout": " 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", "stderr": "", "exit_code": 0} |
| 14 | run_command | {
"command": "cd /workspace && python3 - <<'PY'\nfrom pathlib import Path\np = Path(\"rich/_export_format.py\"); s = p.read_text()\nprint(repr(s[1000:1500]))\nPY\n"
} | {"status": "ok", "stdout": "' src: local(\"FiraCode-Bold\"),\\n url(\"https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Bold.woff2\") format(full{"status": "ok", "stdout": "' 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-ea'\n", "stderr": "", "exit_code": 0} |
| 15 | run_command | {
"command": "cd /workspace && python3 - <<'PY'\nfrom pathlib import Path\np = Path(\"rich/_export_format.py\"); s = p.read_text()\n# Search for the line with Menlo\nimport re\nmatch = re.search(r'<pre style=\\\\\"font-family:Menlo,', s)\nif match:\n print(f\"Found at {match.start()}\")\n print(s[match.start():match.start()+200])\nelse:\n print(\"Not found\")\nPY\n"
} | {"status": "ok", "stdout": "Not found\n", "stderr": "", "exit_code": 0}full{"status": "ok", "stdout": "Not found\n", "stderr": "", "exit_code": 0} |
| 16 | run_command | {
"command": "cd /workspace && python3 - <<'PY'\nfrom pathlib import Path\np = Path(\"rich/_export_format.py\"); s = p.read_text()\n# Look for Menlo without the backslash in the regex\nimport re\nmatch = re.search(r'<pre style=.*Menlo', s)\nif match:\n print(f\"Found at {match.start()}\")\n print(s[match.start():match.start()+200])\nelse:\n print(\"Not found\")\nPY\n"
} | {"status": "ok", "stdout": "Found at 201\n<pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-family:inheritfull{"status": "ok", "stdout": "Found at 201\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\n", "stderr": "", "exit_code": 0} |
| 17 | run_command | {
"command": "cd /workspace && python3 - <<'PY'\nfrom pathlib import Path\np = Path(\"rich/_export_format.py\"); s = p.read_text()\nold = ' <pre style=\\\\\"font-family:Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\\\\\">'\n# Let me try to escape the double quote correctly for the python string\n# The content of the file is: <pre style=\\\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\\\"><code style=\\\"font-family:inherit\\\">{code}</code></pre>\n# Since s is read by read_text(), the backslashes in the file are actual backslashes because it is a triple quoted string in the source code.\n# Let's check the raw content.\nPY\n"
} | {"status": "ok", "stdout": "", "stderr": "", "exit_code": 0}full{"status": "ok", "stdout": "", "stderr": "", "exit_code": 0} |
| 18 | run_command | {
"command": "cd /workspace && python3 - <<'PY'\nfrom pathlib import Path\np = Path(\"rich/_export_format.py\"); s = p.read_text()\nimport re\nmatch = re.search(r'<pre style=\\\\font-family:Menlo,', s)\nif match:\n print(f\"Found at {match.start()}\")\nelse:\n print(\"Not found\")\nPY\n"
} | {"status": "ok", "stdout": "Not found\n", "stderr": "", "exit_code": 0}full{"status": "ok", "stdout": "Not found\n", "stderr": "", "exit_code": 0} |
| 19 | run_command | {
"command": "cd /workspace && python3 - <<'PY'\nfrom pathlib import Path\np = Path(\"rich/_export_format.py\"); s = p.read_text()\n# The character after 'style=' is likely a backslash and a quote.\n# In the sed output: <pre style=\\\"font-family:Menlo...\n# The backslash is because it's inside a triple quoted string in python.\n# Wait, if I use read_text(), I get the exact content of the file.\n# In the file, it is literally: <pre style=\\\"font-family:Menlo...\n# So in a python string, that is represented as '<pre style=\\\\\"font-family:Menlo...'\n# Let's try this.\nold = ' <pre style=\\\\\"font-family:Menlo,\\'DejaVu Sans Mono\\',consolas,\\'Courier New\\',monospace\\\\\">'\nprint(f\"Searching for: {old}\")\nif old in s:\n print(\"Found!\")\nelse:\n print(\"Not found!\")\nPY\n"
} | {"status": "ok", "stdout": "Searching for: <pre style=\\\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\\\">\nNot found!\n", "stderr": "full{"status": "ok", "stdout": "Searching for: <pre style=\\\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\\\">\nNot found!\n", "stderr": "", "exit_code": 0} |
| 20 | run_command | {
"command": "cd /workspace && python3 - <<'PY'\nfrom pathlib import Path\np = Path(\"rich/_export_format.py\"); s = p.read_text()\n# Try to find the position of 'Menlo' and print around it\nidx = s.find('Menlo')\nif idx != -1:\n print(s[idx-50 : idx+100])\nelse:\n print(\"Menlo not found\")\nPY\n"
} | {"status": "ok", "stdout": "style>\n</head>\n<body>\n <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-fafull{"status": "ok", "stdout": "style>\n</head>\n<body>\n <pre style=\"font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-family:inherit\">{code}<\n", "stderr": "", "exit_code": 0} |
| 21 | run_command | {
"command": "cd /workspace && python3 - <<'PY'\nfrom pathlib import Path\np = Path(\"rich/_export_format.py\"); s = p.read_text()\n# Use a simpler replace if possible\nold = 'font-family:Menlo,'\nnew = 'font-family:\\'Fira Code\\',Menlo,'\nif old in s:\n t = s.replace(old, new)\n p.write_text(t)\n print(\"Replaced!\")\nelse:\n print(f\"Not found: {old}\")\nPY\n"
} | {"status": "ok", "stdout": "Replaced!\n", "stderr": "", "exit_code": 0}full{"status": "ok", "stdout": "Replaced!\n", "stderr": "", "exit_code": 0} |
| 22 | run_command | {
"command": "sed -n '10,20p' rich/_export_format.py"
} | {"status": "ok", "stdout": " background-color: {background};\n}}\n</style>\n</head>\n<body>\n <pre style=\"font-family:'Fira Code',Menlo,'DejaVu Sans Mono',consfull{"status": "ok", "stdout": " background-color: {background};\n}}\n</style>\n</head>\n<body>\n <pre style=\"font-family:'Fira Code',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", "stderr": "", "exit_code": 0} |
| 23 | run_command | {
"command": "git diff rich/_export_format.py"
} | {"status": "ok", "stdout": "diff --git a/rich/_export_format.py b/rich/_export_format.py\nindex e7527e52..2499839a 100644\n--- a/rich/_export_format.py\n+++ b/rfull{"status": "ok", "stdout": "diff --git a/rich/_export_format.py b/rich/_export_format.py\nindex e7527e52..2499839a 100644\n--- a/rich/_export_format.py\n+++ b/rich/_export_format.py\n@@ -12,7 +12,7 @@ body {{\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+ <pre style=\"font-family:'Fira Code',Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><code style=\"font-family:inherit\">{code}</code></pre>\n </body>\n </html>\n \"\"\"\n", "stderr": "", "exit_code": 0} |
| 24 | run_command | {
"command": "submit_patch"
} | {"status": "error", "error_type": "CommandError", "error_message": "/bin/bash: submit_patch: command not found\n", "details": {"stdout": "", "stderr": "/bin/basfull{"status": "error", "error_type": "CommandError", "error_message": "/bin/bash: submit_patch: command not found\n", "details": {"stdout": "", "stderr": "/bin/bash: submit_patch: command not found\n", "exit_code": 127}} |
| 25 | submit_patch | {} | {"status": "ok", "patch_size": 523, "files_changed": 1}full{"status": "ok", "patch_size": 523, "files_changed": 1} |
diff --git a/rich/_export_format.py b/rich/_export_format.py
index e7527e52..2499839a 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>
"""
.....................................................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