We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
readline.NewRawReader()
os.Stdin
Ctrl + Space
I want to read Ctrl + Space on Windows, can readline.NewRawReader() help?
package main import ( "fmt" "os" "github.com/chzyer/readline" "golang.org/x/term" ) func main() { fd := int(os.Stdin.Fd()) state, err := term.MakeRaw(fd) if err != nil { fmt.Println(err) return } defer term.Restore(fd, state) stdin := readline.NewRawReader() buf := make([]byte, 100) for { n, err := stdin.Read(buf) fmt.Printf("n = %d, err = %v, buf = %#v\r\n", n, err, buf[:n]) if n > 0 && buf[0] == '\x03' { // `ctrl + c` to exit break } } }
The text was updated successfully, but these errors were encountered:
https://github.com/PowerShell/openssh-portable/blob/latestw_all/contrib/win32/win32compat/tncon.c Can someone implement this c code in go? preferably without cgo.
Refer to https://github.com/chzyer/readline/blob/master/rawreader_windows.go
Sorry, something went wrong.
No branches or pull requests
readline.NewRawReader()
asos.Stdin
on Windows?readline.NewRawReader()
supportCtrl + Space
?I want to read
Ctrl + Space
on Windows, canreadline.NewRawReader()
help?The text was updated successfully, but these errors were encountered: