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.

term_plan9.go 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2019 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package term
  5. import (
  6. "fmt"
  7. "runtime"
  8. "golang.org/x/sys/plan9"
  9. )
  10. type state struct{}
  11. func isTerminal(fd int) bool {
  12. path, err := plan9.Fd2path(fd)
  13. if err != nil {
  14. return false
  15. }
  16. return path == "/dev/cons" || path == "/mnt/term/dev/cons"
  17. }
  18. func makeRaw(fd int) (*State, error) {
  19. return nil, fmt.Errorf("terminal: MakeRaw not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
  20. }
  21. func getState(fd int) (*State, error) {
  22. return nil, fmt.Errorf("terminal: GetState not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
  23. }
  24. func restore(fd int, state *State) error {
  25. return fmt.Errorf("terminal: Restore not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
  26. }
  27. func getSize(fd int) (width, height int, err error) {
  28. return 0, 0, fmt.Errorf("terminal: GetSize not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
  29. }
  30. func readPassword(fd int) ([]byte, error) {
  31. return nil, fmt.Errorf("terminal: ReadPassword not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
  32. }