Skip to content

auth: fix stale host prompt renders by shortening the prompt label#5244

Merged
simonfaltum merged 1 commit into
mainfrom
simonfaltum/auth-host-prompt-shorten
May 12, 2026
Merged

auth: fix stale host prompt renders by shortening the prompt label#5244
simonfaltum merged 1 commit into
mainfrom
simonfaltum/auth-host-prompt-shorten

Conversation

@simonfaltum
Copy link
Copy Markdown
Member

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

Databricks host (e.g. https://<databricks-instance>.cloud.databricks.com):

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.

Example: https://<databricks-instance>.cloud.databricks.com
✔ Databricks host: https://dogfood.staging.databricks.com/?o=60519214█

Test plan

  • Reproduced the bug locally with a 100-col terminal and a typical workspace URL.
  • Verified the fix with the same URL: prompt renders on a single line, no stale duplicates.
  • ./task fmt-q, ./task lint-q, ./task checks clean.
  • go test ./cmd/auth/... passes.

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
@simonfaltum simonfaltum merged commit dec925d into main May 12, 2026
23 of 24 checks passed
@simonfaltum simonfaltum deleted the simonfaltum/auth-host-prompt-shorten branch May 12, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants