Command line client for Write.as https://write.as/apps/cli
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
462 B

  1. // +build !solaris
  2. package gopass
  3. import "golang.org/x/crypto/ssh/terminal"
  4. type terminalState struct {
  5. state *terminal.State
  6. }
  7. func isTerminal(fd uintptr) bool {
  8. return terminal.IsTerminal(int(fd))
  9. }
  10. func makeRaw(fd uintptr) (*terminalState, error) {
  11. state, err := terminal.MakeRaw(int(fd))
  12. return &terminalState{
  13. state: state,
  14. }, err
  15. }
  16. func restore(fd uintptr, oldState *terminalState) error {
  17. return terminal.Restore(int(fd), oldState.state)
  18. }