mirror of
https://github.com/restic/restic.git
synced 2025-12-03 20:51:47 +00:00
switch to golang.org/x/term
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
"golang.org/x/term"
|
||||
"golang.org/x/text/width"
|
||||
)
|
||||
|
||||
@@ -321,7 +321,7 @@ func (t *Terminal) SetStatus(lines []string) {
|
||||
var width int
|
||||
if t.canUpdateStatus {
|
||||
var err error
|
||||
width, _, err = terminal.GetSize(int(t.fd))
|
||||
width, _, err = term.GetSize(int(t.fd))
|
||||
if err != nil || width <= 0 {
|
||||
// use 80 columns by default
|
||||
width = 80
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"golang.org/x/crypto/ssh/terminal"
|
||||
"golang.org/x/term"
|
||||
)
|
||||
|
||||
// clearCurrentLine removes all characters from the current line and resets the
|
||||
@@ -24,7 +24,7 @@ func moveCursorUp(wr io.Writer, fd uintptr) func(io.Writer, uintptr, int) {
|
||||
// CanUpdateStatus returns true if status lines can be printed, the process
|
||||
// output is not redirected to a file or pipe.
|
||||
func CanUpdateStatus(fd uintptr) bool {
|
||||
if !terminal.IsTerminal(int(fd)) {
|
||||
if !term.IsTerminal(int(fd)) {
|
||||
return false
|
||||
}
|
||||
term := os.Getenv("TERM")
|
||||
|
||||
Reference in New Issue
Block a user