mirror of
https://github.com/restic/restic.git
synced 2025-12-11 18:47:50 +00:00
terminal: cleanup determining width
This commit is contained in:
@@ -10,7 +10,6 @@ import (
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"golang.org/x/term"
|
||||
"golang.org/x/text/width"
|
||||
|
||||
"github.com/restic/restic/internal/terminal"
|
||||
@@ -321,9 +320,8 @@ func (t *Terminal) SetStatus(lines []string) {
|
||||
// only truncate interactive status output
|
||||
var width int
|
||||
if t.canUpdateStatus {
|
||||
var err error
|
||||
width, _, err = term.GetSize(int(t.fd))
|
||||
if err != nil || width <= 0 {
|
||||
width = terminal.Width(t.fd)
|
||||
if width <= 0 {
|
||||
// use 80 columns by default
|
||||
width = 80
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user