stackube/vendor/github.com/howeyc/gopass/terminal.go
mozhulee b95dd6a380 Add framework of auth-controller
Change-Id: Ifa8cc0e4abb798c63c9d4ac9297e3e32443125e4
Implements: blueprint auth-controller-framework
Signed-off-by: mozhuli <21621232@zju.edu.cn>
2017-06-22 18:16:27 +08:00

26 lines
462 B
Go

// +build !solaris
package gopass
import "golang.org/x/crypto/ssh/terminal"
type terminalState struct {
state *terminal.State
}
func isTerminal(fd uintptr) bool {
return terminal.IsTerminal(int(fd))
}
func makeRaw(fd uintptr) (*terminalState, error) {
state, err := terminal.MakeRaw(int(fd))
return &terminalState{
state: state,
}, err
}
func restore(fd uintptr, oldState *terminalState) error {
return terminal.Restore(int(fd), oldState.state)
}