In a program I want to read a password from the terminal, using 
golang.org/x/term.
The problem is that there is a possibility that a signal is sent to the 
program, resulting in the terminal state not being restored:
https://play.golang.org/p/4IjLve9gDx0

In case of term.ReadPassword, on Linux I noted that ECHO is restored, but 
let's ignore it.

What I tried to do was to ttemporarily block the signals, using 
signal.Ignore and signal.Reset; the problem is that Reset doesn't reset 
ignored signals.

Looking at the runtime code, Go only use SIG_DFL in special cases.
Is there a reason why Reset don't reset ignore signals?  Portability?

Is there a simple, portable way, to do what I want?

Thanks
Manlio

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/853fa733-fcbb-4213-9aa2-5a6942f7f88dn%40googlegroups.com.

Reply via email to