Discussed in #821
Originally posted by tiangolo May 2, 2024
First Check
Commit to Help
Example Code
import typer
from typing_extensions import Annotated
app = typer.Typer(rich_markup_mode="rich")
@app.command()
def hello(
name: Annotated[
str, typer.Option(help="The [bold]cool[/bold] name of the [green]user[/green]")
],
):
"""
Say [bold]hi[/bold] to the user.
"""
print(f"Hello {name}")
@app.command()
def goodbye(
name: Annotated[
str, typer.Option(help="The [bold]cool[/bold] name of the [green]user[/green]")
],
):
"""
Say [bold]goodbye[/bold] to the user.
"""
print(f"Goodbye {name}")
if __name__ == "__main__":
app()
Description
-
Create this script in main.py
-
In Zsh, start running it with the typer command, start typing: typer main.py run , then hit tab to trigger autocompletion, it shows the two commands, which is correct:
-
goodbye
-
hello
But their Zsh help string includes the Rich markup content:
$ typer main.py run <tab>
goodbye -- Say [bold]goodbye[/bold] to the user.
hello -- Say [bold]hi[/bold] to the user.

It should show plaintext without [bold] markup parts... or better, it should render those parts and show them in actual green color (using the terminal color codes, etc, the stuff Rich does).
Operating System
Linux, macOS
Operating System Details
This applies mainly to Zsh, the behavior might be similar or different in PowerShell. It only applies in shells that can show autocompletion of commands with help sections.
Typer Version
Typer version: 0.12.3
Python Version
any
Additional Context
No response
Discussed in #821
Originally posted by tiangolo May 2, 2024
First Check
Commit to Help
Example Code
Description
Create this script in
main.pyIn Zsh, start running it with the
typercommand, start typing:typer main.py run, then hit tab to trigger autocompletion, it shows the two commands, which is correct:goodbyehelloBut their Zsh help string includes the Rich markup content:
It should show plaintext without
[bold]markup parts... or better, it should render those parts and show them in actual green color (using the terminal color codes, etc, the stuff Rich does).Operating System
Linux, macOS
Operating System Details
This applies mainly to Zsh, the behavior might be similar or different in PowerShell. It only applies in shells that can show autocompletion of commands with help sections.
Typer Version
Typer version: 0.12.3
Python Version
any
Additional Context
No response