1

When executing docker-machine inspect command, instead of the expected highlighted version of JSON piped into jq:

enter image description here

I'm seeing the following plain output (in cmd or ConEmu):

enter image description here

Not sure what needs to be done to enable proper json highlighting.

This happens on Windows 10 machine on which jq ver. 1.5 was installed via Chocolatey:

enter image description here

Simeon Leyzerzon
  • 18,658
  • 9
  • 54
  • 82
  • Isn't it a question to jq authors? Your tool have to output ANSI sequences to get colors in the console. – Maximus Oct 08 '17 at 11:30
  • 1
    Have you tried using the -C command-line option? – peak Oct 08 '17 at 13:04
  • @Maximus: Thanks, I thought they would be active here, but placed a post on jq github issues list just now. @peak: Updated the question: the output is for `docker-machine inspect` command, not sure it where this option would fit, at least I'm getting `flag provided not defined: -C` error when supplying it with `docker-machine inspect -C swarm-1` – Simeon Leyzerzon Oct 08 '17 at 13:10
  • 1
    @SimeonLeyzerzon try adding the `-C` option to jq e.g. `jq -C .` See [invoking jq](https://stedolan.github.io/jq/manual/#Invokingjq) – jq170727 Oct 08 '17 at 17:27
  • Thanks, this worked. I guess ConEmu is not considered a terminal in this case as the jq documentation you pointed me to says: `By default, jq outputs colored JSON if writing to a terminal.` – Simeon Leyzerzon Oct 08 '17 at 17:38

1 Answers1

2

Apparently, this is an idiosyncrasy of jq Windows implementation, forcing the color output with -C option, as hinted by several commenters above, resolved the issue for me:

enter image description here

Simeon Leyzerzon
  • 18,658
  • 9
  • 54
  • 82