mirror of
https://github.com/restic/restic.git
synced 2026-08-31 17:57:13 +00:00
terminal: cleanup determining width
This commit is contained in:
@@ -210,7 +210,7 @@ func clearLine(w int) string {
|
||||
|
||||
// ANSI sequences are not supported on Windows cmd shell.
|
||||
if w <= 0 {
|
||||
if w = terminal.StdoutTerminalWidth(); w <= 0 {
|
||||
if w = terminal.StdoutWidth(); w <= 0 {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ func printProgress(status string, final bool) {
|
||||
|
||||
canUpdateStatus := terminal.StdoutCanUpdateStatus()
|
||||
|
||||
w := terminal.StdoutTerminalWidth()
|
||||
w := terminal.StdoutWidth()
|
||||
if w > 0 {
|
||||
if w < 3 {
|
||||
status = termstatus.Truncate(status, w)
|
||||
|
||||
Reference in New Issue
Block a user