Skip to content

Commit 992c71b

Browse files
authored
Merge pull request #23 from hymkor/isatty
Use `mattn/go-isatty` instead of `golang.org/x/term`
2 parents 8ef8dfe + 6e71c78 commit 992c71b

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ require (
1111
github.com/hymkor/struct2flag v0.0.4
1212
github.com/lib/pq v1.10.9
1313
github.com/mattn/go-colorable v0.1.14
14+
github.com/mattn/go-isatty v0.0.20
1415
github.com/microsoft/go-mssqldb v1.7.2
1516
github.com/nyaosorg/go-box/v3 v3.0.0
1617
github.com/nyaosorg/go-readline-ny v1.12.3
1718
github.com/nyaosorg/go-ttyadapter v0.2.0
1819
github.com/sijms/go-ora/v2 v2.8.22
19-
golang.org/x/term v0.29.0
2020
)
2121

2222
require (
@@ -28,7 +28,6 @@ require (
2828
github.com/golang-sql/sqlexp v0.1.0 // indirect
2929
github.com/google/uuid v1.6.0 // indirect
3030
github.com/hymkor/sxencode-go v0.3.0 // indirect
31-
github.com/mattn/go-isatty v0.0.20 // indirect
3231
github.com/mattn/go-runewidth v0.0.19 // indirect
3332
github.com/mattn/go-tty v0.0.7 // indirect
3433
github.com/ncruces/go-strftime v0.1.9 // indirect

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
7777
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
7878
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
7979
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
80-
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
81-
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
8280
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
8381
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
8482
golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg=

loop.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ import (
1212
"strings"
1313
"time"
1414

15-
"golang.org/x/term"
16-
1715
"github.com/mattn/go-colorable"
16+
"github.com/mattn/go-isatty"
1817

1918
"github.com/hymkor/csvi"
2019
"github.com/hymkor/go-shellcommand"
@@ -310,7 +309,7 @@ func (cfg *Config) Run(driver, dataSourceName string, dbDialect *dialect.Entry)
310309
return ss.Start(ctx, cfg.Script)
311310
}
312311

313-
if !term.IsTerminal(int(os.Stdin.Fd())) && !ss.automatic() {
312+
if !isatty.IsTerminal(os.Stdin.Fd()) && !ss.automatic() {
314313
return ss.StartFromStdin(ctx)
315314
}
316315
return ss.Loop(ctx, ss.newInteractiveIn())

0 commit comments

Comments
 (0)