strawberry
strawberry copied to clipboard
Evaluate rich for use with our CLI
As discussed here: https://github.com/strawberry-graphql/strawberry/pull/1321#discussion_r726507452
tldr:
- Emoji's do not work by default on Windows
- https://github.com/willmcgugan/rich provides a cross platform way of interacting with terminals
- Eval it, see if it helps with emoji on windows
using rich will not allow for emoji usage on Windows as the shell(s) on Windows do not support emojis: https://stackoverflow.com/questions/64940181/cannot-display-emojis-in-windows-powershell-or-wsl-linux-terminal-using-python
I have tried this in the strawberry/cli/commands/server.py
from rich import print
...
def server(schema, host, port, log_level, app_dir):
...
print(f"Running strawberry on http://{host}:{port}/graphql :Strawberry:\n")
this results in this output in the Windows terminal: