Source file src/cmd/vendor/golang.org/x/term/term_plan9.go

     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  
     5  package term
     6  
     7  import (
     8  	"fmt"
     9  	"runtime"
    10  
    11  	"golang.org/x/sys/plan9"
    12  )
    13  
    14  type state struct{}
    15  
    16  func isTerminal(fd int) bool {
    17  	path, err := plan9.Fd2path(fd)
    18  	if err != nil {
    19  		return false
    20  	}
    21  	return path == "/dev/cons" || path == "/mnt/term/dev/cons"
    22  }
    23  
    24  func makeRaw(fd int) (*State, error) {
    25  	return nil, fmt.Errorf("terminal: MakeRaw not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
    26  }
    27  
    28  func getState(fd int) (*State, error) {
    29  	return nil, fmt.Errorf("terminal: GetState not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
    30  }
    31  
    32  func restore(fd int, state *State) error {
    33  	return fmt.Errorf("terminal: Restore not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
    34  }
    35  
    36  func getSize(fd int) (width, height int, err error) {
    37  	return 0, 0, fmt.Errorf("terminal: GetSize not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
    38  }
    39  
    40  func readPassword(fd int) ([]byte, error) {
    41  	return nil, fmt.Errorf("terminal: ReadPassword not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
    42  }
    43  

View as plain text