terminal_unsupported.go 745 B

1234567891011121314151617181920212223242526272829
  1. //go:build js
  2. package terminal
  3. import "errors"
  4. // GetSize reads the dimensions of the current terminal or returns a
  5. // sensible default
  6. func GetSize() (w, h int) {
  7. return 80, 25
  8. }
  9. // IsTerminal returns whether the fd passed in is a terminal or not
  10. func IsTerminal(fd int) bool {
  11. return false
  12. }
  13. // ReadPassword reads a line of input from a terminal without local echo. This
  14. // is commonly used for inputting passwords and other sensitive data. The slice
  15. // returned does not include the \n.
  16. func ReadPassword(fd int) ([]byte, error) {
  17. return nil, errors.New("can't read password")
  18. }
  19. // WriteTerminalTitle writes a string to the terminal title
  20. func WriteTerminalTitle(title string) {
  21. // Since there's nothing to return, this is a NOOP
  22. }