Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect STDOUT isn't a TTY and disable color #3057

Merged
merged 3 commits into from
Aug 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ IMPROVEMENTS:
rolling update could remove an unnecessary amount of allocations [GH-3070]
* api: Redact Vault.Token from AgentSelf response [GH-2988]
* cli: node-status displays node version [GH-3002]
* cli: Disable color output when STDOUT is not a TTY [GH-3057]
* client: Unmount task directories when alloc is terminal [GH-3006]
* client/template: Allow template to set Vault grace [GH-2947]
* client/template: Template emits events explaining why it is blocked [GH-3001]
Expand Down
3 changes: 2 additions & 1 deletion command/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/hashicorp/nomad/api"
"github.com/mitchellh/cli"
"github.com/mitchellh/colorstring"
"golang.org/x/crypto/ssh/terminal"
)

const (
Expand Down Expand Up @@ -126,7 +127,7 @@ func (m *Meta) Client() (*api.Client, error) {
func (m *Meta) Colorize() *colorstring.Colorize {
return &colorstring.Colorize{
Colors: colorstring.DefaultColors,
Disable: m.noColor,
Disable: m.noColor || !terminal.IsTerminal(int(os.Stdout.Fd())),
Reset: true,
}
}
Expand Down
9 changes: 0 additions & 9 deletions vendor/github.com/mattn/go-isatty/LICENSE

This file was deleted.

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

This file was deleted.

2 changes: 0 additions & 2 deletions vendor/github.com/mattn/go-isatty/doc.go

This file was deleted.

9 changes: 0 additions & 9 deletions vendor/github.com/mattn/go-isatty/isatty_appengine.go

This file was deleted.

18 changes: 0 additions & 18 deletions vendor/github.com/mattn/go-isatty/isatty_bsd.go

This file was deleted.

18 changes: 0 additions & 18 deletions vendor/github.com/mattn/go-isatty/isatty_linux.go

This file was deleted.

16 changes: 0 additions & 16 deletions vendor/github.com/mattn/go-isatty/isatty_solaris.go

This file was deleted.

19 changes: 0 additions & 19 deletions vendor/github.com/mattn/go-isatty/isatty_windows.go

This file was deleted.

27 changes: 27 additions & 0 deletions vendor/golang.org/x/crypto/LICENSE

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

22 changes: 22 additions & 0 deletions vendor/golang.org/x/crypto/PATENTS

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

Loading