End the mnemonic prompt at end of input (closes #78)
check / check (push) Waiting to run

term.ReadPassword reads the terminal with a raw read that returns 0
bytes at the end of input and takes that as nothing yet, so Ctrl-D at
the prompt did nothing. On the Unix systems the prompt now sets the
terminal as ReadPassword does and reads the line from standard input,
which reports the end of input; elsewhere, such as Windows, it still
uses ReadPassword. Ctrl-D with nothing typed gives an empty mnemonic,
refused with status 1, and the terminal settings are put back. A test
types Ctrl-D at the prompt on a pseudo-terminal.

Unverified: the prompt was run only on Linux; other systems were built.
Deviation: a Ctrl-H byte is no longer a backspace at the prompt.

Model: opus-5-5
Co-authored-by: clawbot <sneak+clawbot@sneak.cloud>
This commit was merged in pull request #90.
This commit is contained in:
2026-10-14 23:35:24 +02:00
committed by clawbot
parent 2fbc32fe75
commit a08eb28359
9 changed files with 184 additions and 4 deletions
+2 -1
View File
@@ -6,9 +6,11 @@ require (
filippo.io/age v1.3.2
github.com/btcsuite/btcd v0.25.0
github.com/btcsuite/btcd/btcutil v1.2.0
github.com/creack/pty v1.1.25-0.20260601142114-9246436fffe8 // v1.1.24's Open can return another pty's terminal
github.com/spf13/cobra v1.10.2
github.com/stretchr/testify v1.12.1
golang.org/x/crypto v0.57.0
golang.org/x/sys v0.48.0
golang.org/x/term v0.46.0
sneak.berlin/go/secret v0.0.0-20261007105610-ef0ae90768c8
)
@@ -22,5 +24,4 @@ require (
github.com/kcalvinalvin/anet v0.0.0-20251112173137-d8ddc1f6dbee // indirect
github.com/spf13/pflag v1.0.9 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
golang.org/x/sys v0.48.0 // indirect
)