Skip to content

Add flush=True to ConsoleRedirectHandler print statements #544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
mcgr0g opened this issue Apr 1, 2025 · 3 comments
Open
1 task done

Add flush=True to ConsoleRedirectHandler print statements #544

mcgr0g opened this issue Apr 1, 2025 · 3 comments

Comments

@mcgr0g
Copy link
Member

mcgr0g commented Apr 1, 2025

Describe the feature

When using the ConsoleRedirectHandler for OAuth flows, the printed authentication URL sometimes doesn't appear immediately in VS Code terminal outputs (particularly when called through extensions like dbt Power User). This occurs because:

  1. The current implementation doesn't force flush the output buffer (auth.py#L286)
  2. Some IDE/plugin terminal implementations buffer stdout differently than standalone terminals

Request to modify the print statement to:

print(f"Open the following URL in browser for the external authentication: {url}", flush=True)

Describe alternatives you've considered

Waiting for fixes in downstream tools (vscode-dbt-power-user#1629)

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@hashhar
Copy link
Member

hashhar commented Apr 10, 2025

Thanks for the explanation. This makes sense (and it's unexpected that writes to stdout will get bufferred).

It looks like a simple change, are you willing to submit a PR @mcgr0g ?

@mcgr0g
Copy link
Member Author

mcgr0g commented Apr 17, 2025

I’ve created a PR for this issue. @hashhar , please review when you have time.

@DenGodunov
Copy link

DenGodunov commented Apr 25, 2025

@hashhar Hi! Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants