You are not logged in.
Hi there,
Is there any way I can customize the colors for the ANSI color escape codes? To be more clear, I want to change the color for the ANSI escape sequence bellow, also known as red.
\e[0;31m
Thanks in advance.
Last edited by mdcclxv (2023-07-01 22:29:32)
Offline
You can typically change the color theme of your TE (xterm, urxvt, alacritty, …) but that's part of the TEs config and there's no standard way.
Offline
Hmm, that means I'm going the wrong way. My actual problem is that git will show all modified files with a dark red that's hard to read. I'm using KDE's Konsole, which let's me edit the color theme. But git's red color stays the same no matter how I customize Konsole's theme, so I figured I might achieve that by going low level.
I did find some articles describing how to customize git's color output, but I want to replace that dark red for any app, not just for git.
I'm puzzled about how colors in terminal work. One thing I really don't grasp is since Konsole is the one doing the actual drawing of the text, how can an application (being git or any other) jump over Konsole's configuration?
Last edited by mdcclxv (2023-07-01 21:59:08)
Offline
You mean in "git status"?
Is the git color
print '\e[0;31mfoo\e[0m'
Otherwise inspect
for fgbg in 38 48 ; do # Foreground / Background
echo "\\e[${fgbg};5;<number>m"
for color in {0..255} ; do # Colors
# Display the color
printf "\e[${fgbg};5;%sm %3s \e[0m" $color $color
# Display 16 colors per lines
if [ $((($color + 1) % 16)) == 0 ] ; then
echo # New line
fi
done
echo # New line
done
for the concerned color (though it looks like \e[0;31m to me)
Offline
You mean in "git status"?
Is the git colorprint '\e[0;31mfoo\e[0m'
Yes, git status, and yes, that's the color.
Offline
... which let's me edit the color theme
How exactly do you do this - and does this editting result in a change to the color of the "foo" test case seth provided above? If it doesn't change the "foo" color, then it's not the correct color setting(s).
Last edited by Trilby (2023-07-01 22:14:33)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
mdcclxv wrote:... which let's me edit the color theme
How exactly do you do this - and does this editting result in a change to the color of the "foo" test case seth provided above? If it doesn't change the "foo" color, then it's not the correct color setting(s).
Konsole supports Profiles and in each profile I can pick an Appearance Theme, which in itself it's editable.
But ... trying to answer to your second question I found out that Konsole has a bug: sometimes hitting Apply after editing the theme doesn't do the actual applying. That's was my actual issue, now git's output looks the way I want it.
Offline
Thank you both and apologies for wasting your time
Offline