Skip to content

Commit

Permalink
Base diff colorization on stdout not stderr. Fixes #246
Browse files Browse the repository at this point in the history
  • Loading branch information
geofffranks committed Feb 6, 2018
1 parent 6e73c52 commit 169660d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ci/release_notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#Bug Fixes

- `spruce diff` output used to be colorized based on whether or not STDERR was
sent to a terminal. This led to issues piping or redirecting the actual diff output,
so now the decision is based on what type of device STDOUT is. All other `spruce`
subcommands are unaffected, and continue to colorize based on STDERR's device type.

Thanks @giner for pointing this out!
1 change: 1 addition & 0 deletions cmd/spruce/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ func main() {
}

case "diff":
ansi.Color(isatty.IsTerminal(os.Stdout.Fd()))
if len(options.Diff.Files) != 2 {
usage()
return
Expand Down

0 comments on commit 169660d

Please sign in to comment.