mirror of
https://github.com/restic/restic.git
synced 2026-11-06 07:19:21 +00:00
termstatus: move cursor handling to terminal package
This commit is contained in:
1 parent
0ab38faa2e
commit
93ccc548c8
7 files changed
+31
-30
No files matched your search
@@ -69,12 +69,12 @@ func New(wr io.Writer, errWriter io.Writer, disableStatus bool) *Terminal {
|
||||
return t
|
||||
}
|
||||
|
||||
if d, ok := wr.(fder); ok && CanUpdateStatus(d.Fd()) {
|
||||
if d, ok := wr.(fder); ok && terminal.CanUpdateStatus(d.Fd()) {
|
||||
// only use the fancy status code when we're running on a real terminal.
|
||||
t.canUpdateStatus = true
|
||||
t.fd = d.Fd()
|
||||
t.clearCurrentLine = clearCurrentLine(t.fd)
|
||||
t.moveCursorUp = moveCursorUp(t.fd)
|
||||
t.clearCurrentLine = terminal.ClearCurrentLine(t.fd)
|
||||
t.moveCursorUp = terminal.MoveCursorUp(t.fd)
|
||||
}
|
||||
|
||||
return t
|
||||
|
||||
Reference in new issue
Block a user