MCPcopy
hub / github.com/restic/restic / Terminal

Struct Terminal

internal/ui/termstatus/status.go:21–44  ·  view source on GitHub ↗

Terminal is used to write messages and display status lines which can be updated. When the output is redirected to a file, the status lines are not printed.

Source from the content-addressed store, hash-verified

19// updated. When the output is redirected to a file, the status lines are not
20// printed.
21type Terminal struct {
22 rd io.ReadCloser
23 inFd uintptr
24 wr io.Writer
25 fd uintptr
26 errWriter io.Writer
27 msg chan message
28 status chan status
29 lastStatus []string
30 inputIsTerminal bool
31 outputIsTerminal bool
32 canUpdateStatus bool
33
34 outputWriter io.WriteCloser
35 outputWriterOnce sync.Once
36
37 // will be closed when the goroutine which runs Run() terminates, so it'll
38 // yield a default value immediately
39 closed chan struct{}
40
41 clearCurrentLine func(io.Writer, uintptr) error
42 moveCursorUp func(io.Writer, uintptr, int) error
43 moveCursorDown func(io.Writer, uintptr, int) error
44}
45
46type message struct {
47 line string

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected