Documentation
¶
Overview ¶
Package pager manages launching and streaming output to terminal pagers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBrokenPipe ¶
IsBrokenPipe reports whether an error indicates a broken pipe or closed pipe.
Types ¶
type Pager ¶
type Pager struct {
// contains filtered or unexported fields
}
Pager manages an active terminal pager subprocess.
func Start ¶
Start launches a pager (evaluating $DIFFM_PAGER -> $GIT_PAGER -> core.pager -> $PAGER -> less -RFX) when stdout is a terminal and disabled is false. Returns a Pager handle (or nil if no pager was started) and the io.Writer to write to.
func (*Pager) Close ¶
func (p *Pager) Close()
Close closes the pager input stream and waits for the subprocess to finish.
func (*Pager) Done ¶ added in v0.14.0
func (p *Pager) Done() <-chan struct{}
Done returns a channel that is closed when the pager subprocess exits. If p is nil, Done returns nil so it never fires in select statements. If the pager subprocess has already exited, the returned channel is closed and unblocks immediately.