terminal: cleanup determining width

This commit is contained in:
Michael Eischer
2025-09-08 11:03:42 +02:00
parent 0b0dd07f15
commit 43b5166de8
4 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -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 ""
}
}
+1 -1
View File
@@ -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)