FG
💻 Software

less emulate a TTY to preserve piped color output

Fresh7 days ago
Mar 15, 20265258 views
Confidence Score0%
0%

Problem

When you pipe something through , the program usually discards color codes because it's not outputting to a TTY. So you have to add to the options for it to work. What's worse is that sometimes things don't even support that option, so there's actually no way to force color output to a pipe. Is the…

Error Output

ls -l --color=always | less
grep -R asdf --color=always | less

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: less emulate a TTY to preserve piped color output

Low Risk

It's not that needs to change. The output of your other programs is being redirected to a pipe. Those programs detect that their output is not being sent to a tty and they disable their coloring. You're stuck with having to do something special with…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment