Repository navigation
Description
min secret set <id> on macOS has three problems when it reads the value from the terminal. I found them with min secret set claude-oauth --preset anthropic in min 0.8.0-dev.527.
What happens
- The cursor sits at the start of the line, not after
Value for <id>:. - Nothing shows while you type. A row of
*appears only after you press Return. - After Return, the command takes about 18 s to finish when the id is new, and about 27 s when it replaces a value. It prints nothing during that time, so it looks hung.
Expected
- The cursor waits after the colon.
- The prompt either shows nothing while you type, or one
*per key. - The command finishes within about a second of Return.
Cause
1 and 2. read_terminal in crates/minimal/src/cmd/secret.rs uses inquire::Password with its default display mode, PasswordDisplayMode::Hidden. In that mode, inquire 0.9.4 draws only the prompt text and then returns the cursor to column 0. Each keystroke redraws nothing. Captured under a pty: the prompt is followed by a bare \r, and each key produces only \x1b[?25l\r\x1b[?25h. inquire prints the masked answer only after the prompt is submitted.
3. set_item in crates/bep/src/store.rs first checks whether the item exists. It then adds the item and reads it back. Each check calls Keychain::items, which runs the keychain tool's dump-keychain -a. That command lists every item in every keychain in the search list. On a login keychain with 209 items, one run takes 8.8 s (measured twice). A new id runs it twice. A replaced value runs it three times: once for the existing item, once for the staged copy, and once for the final item. The time grows with the size of the keychain, not the size of the secret.
Fix
- Prompt: set a display mode that renders input, such as
.with_display_mode(PasswordDisplayMode::Masked), or read the value with a no-echo line read that leaves the cursor after the prompt.Maskedshows how many characters the value has. - Keychain: look up the one item by service and account, for example with
find-generic-password -s <service> -a <id>or through the Keychain Services API, and read its access list from that item alone. Do not list the whole keychain.
Reproduce
min secret set some-new-id --preset anthropic
Type a value, press Return, and time how long the command takes to return.
Activity
norrietaylor commentedon Nov 17, 2026
Fixed by #3465, merged 2026-11-17.