Description of problem: systemd prints raw escape codes if custom options are set in the $LESS environment variable. For example, use the -F option to auto-quit if the output fits in the terminal: $ export LESS="-F" $ systemd-delta ESC[1;32m[EQUIVALENT]ESC[0m /etc/systemd/system/default.target → /usr/lib/systemd/system/default.target 1 overridden configuration files found. Personally, I have in my ~/.bashrc export LESS="-FiX" If I unset the $LESS environment variable, then I get green text for "[EQUIVALENT]" $ unset LESS $ systemd-delta [EQUIVALENT] /etc/systemd/system/default.target → /usr/lib/systemd/system/defaul ^^^^^^^^^^^^ green I see this with other systemd commands also, e.g., systemctl list-units tries to print "failed" in red letters, but I get this: systemd-...-clean.service loaded ESC[1;31mfailed failed ESC[0m Cleanup of Temporary Directories systemd-...-setup.service loaded ESC[1;31mfailed failed ESC[0m Recreate Volatile Files and Directories Side-note: those units failed because of bug 857708 Version-Release number of selected component (if applicable): systemd-44-20.fc17.x86_64 less-444-5.fc17.x86_64 How reproducible: every time Steps to Reproduce: 1. set your favorite options in the $LESS environment variable export LESS="-F" 2. systemd-delta 3. systemctl list-units Actual results: Ugly raw escape codes like ESC[1;31m are printed Expected results: Red or green text, or plain uncolored text if colors not possible Additional info:
A workaround is to use the --no-pager option (where applicable): $ systemd-delta --no-pager [EQUIVALENT] /etc/systemd/system/default.target → /usr/lib/systemd/system/default.target 1 overridden configuration files found. $ systemctl list-units --no-pager | less ... systemd-...-clean.service loaded failed failed Cleanup of Temporary Direc systemd-...-setup.service loaded failed failed Recreate Volatile Files an ...
It's the same underlying issue as in bug 868383. *** This bug has been marked as a duplicate of bug 868383 ***