mirror of
https://github.com/kopia/kopia.git
synced 2026-05-18 19:54:37 -04:00
refactor(cli): leverage x/term.IsTerminal (#5308)
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/mattn/go-isatty"
|
||||
"golang.org/x/term"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -25,7 +25,7 @@ func (c *App) enableErrorNotifications() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
if isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd()) {
|
||||
if fd, err := intFd(os.Stdout); err == nil && term.IsTerminal(fd) {
|
||||
// interactive terminal, don't send notifications
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user