refactor(cli): leverage x/term.IsTerminal (#5308)

This commit is contained in:
Julio López
2026-04-13 19:17:55 -07:00
committed by GitHub
parent 55629c6d12
commit 40e645e11c
2 changed files with 3 additions and 3 deletions

View File

@@ -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
}

2
go.mod
View File

@@ -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