-
Notifications
You must be signed in to change notification settings - Fork 18k
x/term: operation not supported by device #65095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This error comes from the ioctl syscall when trying to change the setting of the tty device. Are you sure your device supports such operation? |
What is the standard input file of your process? On macOS, usually it is the Terminal application, in which case this program silently succeeds: $ cat a.go
package main
import (
"os"
"golang.org/x/term"
)
func main() {
oldState, err := term.MakeRaw(int(os.Stdin.Fd()))
if err != nil {
panic(err)
}
defer term.Restore(int(os.Stdin.Fd()), oldState)
}
$ go run a.go But If you close stdin:
or read from a regular file:
then you can't use terminal ioctls on stdin. |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
Go version
go version go1.21.4 darwin/amd64
Output of
go env
in your module/workspace:What did you do?
run the sample code as from https://pkg.go.dev/golang.org/x/term#section-readme
oldState, err := term.MakeRaw(int(os.Stdin.Fd())) if err != nil { panic(err) } defer term.Restore(int(os.Stdin.Fd()), oldState)
What did you see happen?
The code failed with error message
operation not supported by device
What did you expect to see?
I suppose there should be no error when executing this code. at the same time the error message is so geneirc dont give any information why run into this error
The text was updated successfully, but these errors were encountered: