You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bab9198
Browse filesBrowse the repository at this point in the historyBrowse files
Show a blank prompt glyph until invalid input is edited (#7314)
## Changes
The `cmdio` prompt glyph is now blank until the first edit or Enter.
After that it shows a cross while the input is invalid and a checkmark
once it is valid. A prompt without `Validate` still shows the checkmark.
An empty bracketed paste, which some terminals send when the clipboard
is empty, is now ignored. It no longer counts as an edit and no longer
clears the error line.
## Why
The glyph ran `Validate` on every render, so a prompt that rejects empty
input, such as the `databricks configure` host prompt, opened with a red
cross before anything was typed.
This change was part of #7195 and was split out because it affects every
prompt that uses `Validate`, including the `databricks auth login`
profile name prompt when the default name is already taken.
## Tests
- The golden for an empty validated prompt now shows the blank glyph.
- New prompt tests cover Enter before any edit, an empty input that is
already valid, navigation keys and Backspace on an empty prompt, and an
empty paste.
- `libs/cmdio/...` and `cmd/configure` unit tests pass.
This pull request and its description were written by Isaac.
---------
Co-authored-by: Isaac <no-reply@databricks.com>
* Prompts that validate their input, such as the `databricks configure` host prompt, no longer open with a red cross before anything is typed. ([#7314](https://github.com/databricks/cli/pull/7314))
0 commit comments