First Check
Commit to Help
Example Code
import typer
def main(name: str):
typer.echo(typer.style(f"Hello {name}", fg=typer.colors.GREEN))
if __name__ == "__main__":
typer.run(main)
Description
How to force colorize output if using pager such as less?
command
$ python main.py typer
Hello typer
with green color.
$ poetry run python main.py typer | cat
Hello typer
with plain color.
Can we tell typer force colorize output such as --color or --color=always option?
Operating System
Linux
Operating System Details
No response
Typer Version
0.4.0
Python Version
Python 3.10.1
Additional Context
No response
First Check
Commit to Help
Example Code
Description
How to force colorize output if using pager such as
less?command
with green color.
$ poetry run python main.py typer | cat Hello typerwith plain color.
Can we tell typer force colorize output such as
--coloror--color=alwaysoption?Operating System
Linux
Operating System Details
No response
Typer Version
0.4.0
Python Version
Python 3.10.1
Additional Context
No response