Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // EscSequenceTimeout is the amount of time within which runes that make up // an escape sequence are supposed to follow each other. Modern terminal // emulators send escape sequences very fast, so 10ms is more than // sufficient. SSH connections on a slow link might be problematic though. EscSequenceTimeout = 10 * time.Millisecond )
Functions ¶
This section is empty.
Types ¶
type AsyncReader ¶
type AsyncReader struct {
// contains filtered or unexported fields
}
AsyncReader delivers a Unix fd stream to a channel of runes.
func NewAsyncReader ¶
func NewAsyncReader(rd *os.File) *AsyncReader
NewAsyncReader creates a new AsyncReader from a file.
func (*AsyncReader) Chan ¶
func (ar *AsyncReader) Chan() <-chan rune
Chan returns a channel onto which the AsyncReader writes the runes it reads.
func (*AsyncReader) Close ¶
func (ar *AsyncReader) Close()
Close releases files and channels associated with the AsyncReader. It does not close the file used to create it.
func (*AsyncReader) ErrorChan ¶
func (ar *AsyncReader) ErrorChan() <-chan error
ErrorChan returns a channel onto which the AsyncReader writes the errors it encounters.
func (*AsyncReader) Run ¶
func (ar *AsyncReader) Run()
Run runs the AsyncReader. It blocks until Quit is called and should be called in a separate goroutine.
type CursorPosition ¶
type CursorPosition Pos
type MouseEvent ¶
type PasteSetting ¶
type PasteSetting bool
type Pos ¶
type Pos struct {
// contains filtered or unexported fields
}
Pos is the position in a terminal.
type ReadUnit ¶
type ReadUnit interface {
// contains filtered or unexported methods
}
ReadUnit represents one "thing" that the Reader has read. It is one of the following: RawRune (when the reader is in the raw mode), Key, CursorPosition, MouseEvent, or PasteSetting.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader converts a stream of events on separate channels.
func (*Reader) Close ¶
func (rd *Reader) Close()
Close releases files associated with the Reader. It does not close the file used to create it.
func (*Reader) ErrorChan ¶
ErrorChan returns the channel onto which the Reader writes errors it came across during the reading process.
func (*Reader) Run ¶
func (rd *Reader) Run()
Run runs the Reader. It blocks until Quit is called and should be called in a separate goroutine.
Notes ¶
Bugs ¶
AsyncReader relies on the undocumented fact that (*os.File).Read returns an *os.File.PathError