Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you want to enable this globally, you'll want a terminal feature, not a process that you pipe output into, because a pipe would be disruptive to some command (two problems are that stdout and stderr would appear out-of-order and buffered, and that some commands just behave differently when outputting to a terminal).</p> <p>I don't know of any “conventional” terminal with this feature. It's easily done in Emacs, in a <code>term</code> buffer: configure <code>font-lock-keywords</code> for <code>term-mode</code>.</p> <p>However, you should think carefully whether you really want that feature all the time. What if the command has its own colors (e.g. <code>grep --color</code>, <code>ls --color</code>)? Maybe it would be better to define a short alias to a <a href="https://stackoverflow.com/questions/4267400/colour-highlighting-output-based-on-regex-in-shell/4269167#4269167">colorizer command</a> and run <code>myCommand 2&gt;&amp;1|c</code> when you want to colorize <code>myCommand</code>'s output. You could also <a href="https://stackoverflow.com/questions/4267400/colour-highlighting-output-based-on-regex-in-shell/4269864#4269864">alias some specific always-colorize commands</a>.</p> <p>Note that the return status of a pipeline is its <em>last</em> command, so if you run <code>myCommand | c</code>, you'll get the status of <code>c</code>, not <code>myCommand</code>. Here's a bash wrapper that avoids this problem, which you can use as <code>w myCommand</code>:</p> <pre><code>w () { "$@" | c return $PIPESTATUS[0] } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload