django-typer
django-typer copied to clipboard
shellcompletion complete should print to the command's stdout.
This is tricky because we don't want to redirect stdout using contextlib because that will mess up debuggers which is a main reason to use complete.
To make this work is definitely another patch situation. Typer sends the completions to click.echo which does take a stream as an argument, but theres no way to hook into Typer's use of the call. echo defaults to stdout, but it would be possible to patch the click._compat.get_text_stdout/err functions to do this...
Should click.echo (and typer.echo) use the command stdout/stderr streams when called within the command context? probably... we do have the context tools to make this work.