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:
@@ -20,8 +20,12 @@ func StdoutCanUpdateStatus() bool {
|
||||
return CanUpdateStatus(os.Stdout.Fd())
|
||||
}
|
||||
|
||||
func StdoutTerminalWidth() int {
|
||||
w, _, err := term.GetSize(int(os.Stdout.Fd()))
|
||||
func StdoutWidth() int {
|
||||
return Width(os.Stdout.Fd())
|
||||
}
|
||||
|
||||
func Width(fd uintptr) int {
|
||||
w, _, err := term.GetSize(int(fd))
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user