This patch adds colored output to the strace program.
From strace --help
--color[=WHEN]
colorize the output; WHEN can be 'always', 'auto' (default), or 'never'
always
will always colorize the outputnever
will never colorize the outputauto
will only colorize the output when standard output is connected to a terminal
Using --output
or setting the NO_COLOR
environment variable will disable the colored output.
strace-with-colors package from AUR
git clone https://aur.archlinux.org/strace-with-colors.git
cd strace-with-colors
makepkg -si
strace-with-colors package from Copr
dnf copr enable xfgusta/strace-with-colors
dnf install strace-with-colors
Clone the strace git repository and go to the directory
git clone https://github.com/strace/strace
cd strace
Checkout the tag v6.3
(latest version)
git checkout tags/v6.3
Get the patch source here and apply it
curl -O https://raw.githubusercontent.com/xfgusta/strace-with-colors/main/strace-with-colors.patch
git apply strace-with-colors.patch
Now you are ready to build and install strace with colors!
./bootstrap
./configure --enable-mpers=no
make install
You may need to install some dependencies before, like:
make
autoconf
automake
gcc
- ...
You can actually check all the strace installation instructions here.
The program will be in the /usr/local/bin
directory. You can uninstall it running make uninstall
.
Here is the color scheme used in the screenshot above:
FG | Name | Color |
---|---|---|
0 | Black | #2d3139 |
1 | Red | #e06c75 |
2 | Green | #98c379 |
3 | Yellow | #e5c07b |
4 | Blue | #528bff |
5 | Magenta | #c678dd |
6 | Cyan | #56b6c2 |
7 | White | #d7dae0 |