On 30 Jun 2023, at 14:15, stan via users <users@lists.fedoraproject.org> wrote:
On Thu, 29 Jun 2023 17:44:01 +0200lejeczek via users <users@lists.fedoraproject.org> wrote:On 28/06/2023 20:26, stan via users wrote:
Operator error. Exporting the wrong name because of a cut and
paste. Once I fixed that, definitely works to change colors in
journalctl output, will have to tune it to get what I want.
I put this in my .bashrc so everything is set on login.
SYSTEMD_PAGER=less
export SYSTEMD_PAGER
SYSTEMD_LESS="[list of less options]"
export SYSTEMD_LESS
_______________________________________________
Not exactly, I'd not think of it as _the_ solution - (I much
This is correct. After I posted this, I found that it is impossible toactually set the colors in journalctl because they are hard coded asescape sequences when the data is written into the journal. What I haddone is remove the R option to less, which turns off such escapesequences. In my case, the less options I set for color then seems tohighlight the ESC in light red, so I know which lines journalctl wantsto highlight, but not their status. That isn't optimal, but thehorrible dark blue on black background is gone, so I can live with it.
I would be nice to be able to configure the colours used. Would need a PR against systemd I expect to get this changed.
One hack would be to edit the output and replace the escape sequence for the poor colour to use a replacement using sed I guess.
For example change the blue to red.
SYSTEMD_COLORS=16 journalctl | sed 's/\x1b\[0;34m/\x1b\[0;31m/g' | more
I use more not less and notice that less does not show the coloured output.