<p>I use kubectl with watch so I can have a &quot;realtime&quot; view of what I'm ding as I'm updating pods and stuff, usually I go like:</p>
<pre><code>watch -n1 kubectl get pods 
</code></pre>
<p>Now I want to do the same using kubecolor as the output is much better but the watch command won't display the colors, as I read on the man pages I'm trying:</p>
<pre><code>watch -n1 --color &quot;kubecolor get pods&quot; 
</code></pre>
<p>Without any luck, colors are not being displayed :(</p>
<p>Does someone knows how to properly do it ?</p>

William Añez
<p>The reason is that <code>kubecolor</code> detects that it is running non-interactively.
Therefore the problem is not the <code>watch</code> command, but <code>kubecolor</code> itself that disables color output when combined with watch.</p>
<p>As commented by Philippe the switch <code>--force-colors</code> for the <code>kubecolor</code> command prevents this.</p>
<p>In general: If you are using a linux operating system, you can use <code>unbuffer</code> to get the output working as expected. For Debian/Ubuntu install the <code>expect</code> package to get <code>unbuffer</code>.</p>
<p>The command to be used could then look as this:</p>
<pre><code>watch -c unbuffer kubecolor get pods
</code></pre>
<p>In addition to that <code>kubectl</code> (and <code>kubecolor</code>) support the <code>--watch</code> switch itself. Does not solve all use cases, but since it uses the API server watch method it is more efficient.</p>
