auth: fix stale host prompt renders by shortening the prompt label#5244
Merged
Conversation
The `Databricks host (e.g. https://<databricks-instance>.cloud.databricks.com)`
label is long enough that typing or pasting a workspace URL pushes the line
past the terminal width and it wraps. promptui's screenbuf does not account
for wrapped lines, so each keystroke leaves a stale copy of the prompt on
screen instead of overwriting it.
Print the example on a separate line above the prompt and keep the label
itself short ("Databricks host"). With a realistic URL this fits comfortably
on any reasonable terminal width.
Co-authored-by: Isaac
mihaimitrea-db
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
In
databricks auth login, after selecting→ Enter a host URL manually, typing or pasting a workspace URL would leave the prompt visibly stuck on screen — the same✔ Databricks host …line stacked up many times before the next prompt appeared. Functionally everything still worked, but the picker output looked broken.Changes
Before: The prompt label was
which is ~75 characters before the user even types anything. Once the value pushed the line past the terminal width, promptui's
screenbuf(which only tracks logical lines, not wrapped physical lines) failed to clear the previous render on each keystroke, and stale copies stacked up.Now: The example is printed once on its own line above the prompt and the prompt label is just
Databricks host. With a realistic workspace URL the whole line stays well under 80 characters and never wraps in normal terminals.Test plan
./task fmt-q,./task lint-q,./task checksclean.go test ./cmd/auth/...passes.