From 40e645e11cebbdd95fdf413e6772c6da1b545c38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20L=C3=B3pez?= <1953782+julio-lopez@users.noreply.github.com> Date: Mon, 13 Apr 2026 19:17:55 -0700 Subject: [PATCH] refactor(cli): leverage x/term.IsTerminal (#5308) --- cli/error_notifications.go | 4 ++-- go.mod | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/error_notifications.go b/cli/error_notifications.go index 4061b0c13..40e92c1a0 100644 --- a/cli/error_notifications.go +++ b/cli/error_notifications.go @@ -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 } diff --git a/go.mod b/go.mod index ee0cde247..b4a35f3eb 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,6 @@ require ( github.com/kopia/htmluibuild v0.0.1-0.20260407042614-ef9b7e16a97f github.com/kylelemons/godebug v1.1.0 github.com/mattn/go-colorable v0.1.14 - github.com/mattn/go-isatty v0.0.20 github.com/minio/minio-go/v7 v7.0.100 github.com/mocktools/go-smtp-mock/v2 v2.5.3 github.com/mxk/go-vss v1.2.1 @@ -122,6 +121,7 @@ require ( github.com/klauspost/cpuid/v2 v2.3.0 // indirect github.com/klauspost/crc32 v1.3.0 // indirect github.com/kr/fs v0.1.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/minio/crc64nvme v1.1.1 // indirect github.com/minio/md5-simd v1.1.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect