⚠️ UPDATE: Revised Scope
Upon further investigation, this is not limited to a missing emoji setting.
There are two core issues
ConsoleOptions is missing an emoji field. Therefore, emoji overrides passed to console.print() are ignored.
- Multiple classes (
Table, Rule, Columns, and Measure) fail to pass some or all of emoji, markup, and highlight settings from their ConsoleOptions back to console.render_str().
I have a fix but I am currently unable to create a pull request in this repo.
See this fork for the fix:
https://github.com/kmvanbrunt/rich/tree/emoji_console_option
Original Description
When printing a complex renderable like a Table, passing emoji=False to console.print() does not disable emoji parsing within the table cells if the Console was initialized with emoji=True (the default).
This appears to be because ConsoleOptions does not include an emoji field, and Console.render() does not propagate the emoji preference to render_str().
Here is code to reproduce the bug.
from rich.console import Console
from rich.table import Table
# Create Console with markup and emoji enabled
console = Console(markup=True, emoji=True)
t = Table(show_header=False)
t.add_row("[blue]some text[/blue]", ":1234:")
print("Normal print() shows markup and emoji rendering")
console.print(t)
# Attempt to override markup and emoji when printing a Table
print("Print overrides only work for markup and the emoji still renders")
console.print(t, markup=False, emoji=False)
Here is a screenshot of the results.
Platform
rich==14.3.3
Python 3.11.2
Debian 12.13
Upon further investigation, this is not limited to a missing
emojisetting.There are two core issues
ConsoleOptionsis missing anemojifield. Therefore,emojioverrides passed toconsole.print()are ignored.Table,Rule,Columns, andMeasure) fail to pass some or all ofemoji,markup, andhighlightsettings from theirConsoleOptionsback toconsole.render_str().I have a fix but I am currently unable to create a pull request in this repo.
See this fork for the fix:
https://github.com/kmvanbrunt/rich/tree/emoji_console_option
Original Description
When printing a complex renderable like a
Table, passingemoji=Falsetoconsole.print()does not disable emoji parsing within the table cells if theConsolewas initialized withemoji=True(the default).This appears to be because
ConsoleOptionsdoes not include anemojifield, andConsole.render()does not propagate theemojipreference torender_str().Here is code to reproduce the bug.
Here is a screenshot of the results.
Platform
rich==14.3.3
Python 3.11.2
Debian 12.13