From 722aa8dd196ca9d52315d39afc6ce8d2a57f9ca7 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 12 May 2026 17:53:17 +0200 Subject: [PATCH] auth: fix stale host prompt renders by shortening the prompt label The `Databricks host (e.g. https://.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 --- NEXT_CHANGELOG.md | 1 + cmd/auth/auth.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 39b3741607..4c456a57ad 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -8,6 +8,7 @@ * `databricks auth describe` now reports where U2M (`databricks-cli`) tokens are stored: `plaintext` (`~/.databricks/token-cache.json`) or `secure` (OS keyring), and the source of the choice (env var, config setting, or default). * Marked the default profile in the interactive pickers shown by `databricks auth switch`, `databricks auth logout`, `databricks auth token`, and `databricks auth login`, and moved it to the top of the list. `databricks auth login` and `databricks auth logout` now offer the same selectors as `databricks auth token` and `databricks auth switch` respectively. * The interactive auth profile pickers now start in search mode so typing immediately filters the list, and the action entries (`+ Create a new profile`, `→ Enter a host URL manually`) are visually distinct from real profiles and stay visible regardless of the search query. +* Shortened the host prompt label shown after `→ Enter a host URL manually` in `databricks auth login` so the prompt no longer leaves stale lines on screen when typing or pasting a host URL. ### Bundles * Stop applying `presets.name_prefix` (and the dev-mode `[dev ]` rename) to `vector_search_endpoints` ([#5209](https://github.com/databricks/cli/pull/5209)). diff --git a/cmd/auth/auth.go b/cmd/auth/auth.go index 28aa1269df..7ef3a9f72a 100644 --- a/cmd/auth/auth.go +++ b/cmd/auth/auth.go @@ -45,8 +45,13 @@ func promptForHost(ctx context.Context) (string, error) { return "", errors.New("the command is being run in a non-interactive environment, please specify a host using --host") } + // The hint is printed separately so the prompt label stays short. + // promptui's screenbuf does not account for terminal line wrapping, and a + // long "label + value" line that wraps causes each keystroke to leave a + // stale render on screen instead of overwriting the previous one. + cmdio.LogString(ctx, "Example: https://.cloud.databricks.com") return cmdio.RunPrompt(ctx, cmdio.PromptOptions{ - Label: "Databricks host (e.g. https://.cloud.databricks.com)", + Label: "Databricks host", }) }