mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-18 12:59:31 +00:00
Upgraded from 99c19923, branch release-3.0. This required fetching or upgrading the following: * k8s.io/api to kubernetes-1.9.1 * k8s.io/apimachinery to kubernetes-1.9.1 * github.com/juju/ratelimit to 1.0.1 * github.com/spf13/pflag to 4c012f6d Also, update Scope's imports/function calls to be compatible with the new client.
26 lines
462 B
Go
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)
|
|
}
|