Skip to content

Commit

Permalink
internal/debug: support color terminal for cygwin/msys2 (#17740)
Browse files Browse the repository at this point in the history
- update go-colorable, go-isatty, go-runewidth packages
- use go-isatty instead of log/term and remove log/term package
  • Loading branch information
hackmod authored and fjl committed Sep 29, 2018
1 parent d9e324a commit 44eb695
Show file tree
Hide file tree
Showing 23 changed files with 326 additions and 296 deletions.
4 changes: 2 additions & 2 deletions internal/debug/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ import (
"runtime"

"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log/term"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/metrics/exp"
"github.com/fjl/memsize/memsizeui"
colorable "github.com/mattn/go-colorable"
"github.com/mattn/go-isatty"
"gopkg.in/urfave/cli.v1"
)

Expand Down Expand Up @@ -101,7 +101,7 @@ var (
)

func init() {
usecolor := term.IsTty(os.Stderr.Fd()) && os.Getenv("TERM") != "dumb"
usecolor := (isatty.IsTerminal(os.Stderr.Fd()) || isatty.IsCygwinTerminal(os.Stderr.Fd())) && os.Getenv("TERM") != "dumb"
output := io.Writer(os.Stderr)
if usecolor {
output = colorable.NewColorableStderr()
Expand Down
21 changes: 0 additions & 21 deletions log/term/LICENSE

This file was deleted.

13 changes: 0 additions & 13 deletions log/term/terminal_appengine.go

This file was deleted.

13 changes: 0 additions & 13 deletions log/term/terminal_darwin.go

This file was deleted.

18 changes: 0 additions & 18 deletions log/term/terminal_freebsd.go

This file was deleted.

14 changes: 0 additions & 14 deletions log/term/terminal_linux.go

This file was deleted.

7 changes: 0 additions & 7 deletions log/term/terminal_netbsd.go

This file was deleted.

20 changes: 0 additions & 20 deletions log/term/terminal_notwindows.go

This file was deleted.

7 changes: 0 additions & 7 deletions log/term/terminal_openbsd.go

This file was deleted.

9 changes: 0 additions & 9 deletions log/term/terminal_solaris.go

This file was deleted.

26 changes: 0 additions & 26 deletions log/term/terminal_windows.go

This file was deleted.

5 changes: 5 additions & 0 deletions vendor/github.com/mattn/go-colorable/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions vendor/github.com/mattn/go-colorable/colorable_others.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 44eb695

Please sign in to comment.