Files
secret/internal
sneak d01a277448
check / check (push) Canceled after 0s
Ask for the passphrase on the controlling terminal, not stdin (closes #144)
The passphrase and mnemonic prompts open /dev/tty and ask there, so
`echo v | secret add s1 --force`, `secret encrypt` and `secret decrypt`
with piped input ask at a terminal instead of failing. Only a process
with no controlling terminal still gets the error naming the variable to
set; stdin and stderr no longer matter.

On SIGINT or SIGTERM, Entry() restores the settings of /dev/tty instead
of stdin, since that is where the prompt turns echo off; with stdin
piped, Ctrl-C at the prompt otherwise left echo off.

The two tests that pin the no-terminal message run the binary in a new
session, so it has no terminal wherever the tests run.

Unverified by a test: the echo restore after Ctrl-C, checked by hand.

Model: opus-5-5
2026-10-14 18:54:57 +00:00
..