Skip to content
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

add ReadQueryResponses method that will read ansi responses on windows #249

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions input/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ func NewDriver(r io.Reader, term string, flags int) (*Driver, error) {
return d, nil
}

// ReadQueryResponses is equivalent to ReadEvents on non-Windows systems. However,
// on windows systems this method will pull ansi responses from the tty instead of trying
// to pull key/mouse input from windows' ReadConsoleInput syscall, which is what ReadEvents does
func (d *Driver) ReadQueryResponses() (e []Event, err error) {
return d.readEvents()
}

// Cancel cancels the underlying reader.
func (d *Driver) Cancel() bool {
return d.rd.Cancel()
Expand Down