Guake terminal displays incorrect colors (insufficient contrast) - linux

I use two dropdown terminals in parallel: Yakuake and Guake.
When using Guake, the colors are way too dark, which makes much of the colored text unreadable because of insufficient contrast. The problem is most severe when displaying color #4 (dark blue) on black background (which is the default color ls displays directories with) or in Midnight Commander (default theme, dark blue background).
Yakuake displays all 16 colors correctly and the text is readable very well, the colored output of ls and Midnight Commander.
My OS is Linux 5.15.11-gentoo with plasma-5.88.0, gtk+-2.24.33 and gtk+-3.24.29. Here is my TERM setting in the environment:
TERM=xterm-256color
COLORTERM=yes
I tried all available Guake themes and all of them have horrible contrast. Either all colors are too dark, or the other way around - all of them are too bright. It seems Guake somehow compresses the color contrast.
I also tried defining custom colors, copying the color settings from Yakuake, but even though I set specific colors explicitly, the actually displayed colors were darker. I validated this with a color picker.
Changing the GTK Theme setting in Guake's preference tab General did not yield any success either.
The question is: Why does Guake alter the colors? Is there a way to turn this off and let it display the actual colors I specified? The problem must be with Guake or GTK because everything else is identical when using Yakuake (environment, Midnight Commander colors, ls colors, ...)
The following screenshots demonstrate my Guake Appearance settings:
And here is some Guake support information:
<details><summary>$ guake --support</summary>
Guake Version: 3.8.0
Vte Version: 0.64.2
Vte Runtime Version: 0.64.2
--------------------------------------------------
GTK+ Version: 3.24.29
GDK Backend: <GdkX11.X11Display
--------------------------------------------------
Desktop Session: /usr/share/xsessions/plasma
--------------------------------------------------
Display: :0
RGBA visual: True
Composited: True
Thanks a lot in advance.

It turns out ls renders directories as bold font with the expectation that the text will appear in bright color. As explained by Guake developers this is non-standard behavior used with old terminals that did not supported fonts. Guake follows the ANSI standard and renders the text correctly.
The solution is to tweak the ls colors accordingly.

Related

Disable gdb highlight colors

I'm using gdb on Fedora 32 and gdb prints information with highlight color.
However the color has less contrast for example dark blue text on black background.
How can I disable the highlight color?
Use set style enabled off to disable all styling, as the manual says.

Which ANSI code should I use to make text muted (dark gray)?

When I use code 1;30m it produces different results:
Xshell 5: gray and bold
PhpStorm terminal: only bold
Windows console: only gray
The goal is to make a part of text to be slightly muted, but if it possible, it should display similarly in most terminal clients.
Anyway I don't understand how "bold" flag can change the foreground color. What am I doing wrong?
ANSI didn't specify that. ANSI listed black, red, etc., and also mentions bold. How a particular terminal displays bold+black is implementation-defined (no standard applies).
"ANSI" refers to x3.64, withdrawn many years ago, replaced by ECMA-48 (aka ISO 6429).
For your amusement:
ECMA-48:
Control Functions for Coded Character Sets
Aren't bright colors the same as bold? (xterm FAQ)
How do I get color with VT100? (ncurses FAQ)
Confirmed, on xterm that displays a muted gray and on emacs it produces black.
You can try a 256-color code like ^[[38;2;85;85;85m (which may also give inconsistent results for the reasons mentioned in #ThomasDickey's linked articles).

Remove terminal border colors from vim colorschemes

I want the color scheme to span completely across the terminal boundaries. I am using Color Scheme Scroller Plugin to switch between different theme. I have uploaded a .gif file so that you can clearly see what I want to get fixed. Vim colorschemes doesn't completely change the color of editor. There are some terminal color's borders left around the vim's overridden color scheme. How would I fix it.
Please check the image on this link. Stackoverflow doesn't allow uploading an image > 2Mb
You can't do that from Vim itself.
Terminal emulators use that padding to preserve readability when characters are displayed next to the borders of the window. The programs you run in your terminal have no knowledge of that padding and thus no ability to change it.
But you can read the documentation of your terminal emulator or take a look at its source code to find a way to enable/adjust/disable that padding.
FWIW, there's no way to change that in Terminal but it can be done for iTerm.
Alternatively, you could simply set the background color of your terminal to the one used in your vim colorscheme.
The image appears to depict behavior outside vim's control:
it is using a terminal emulator (could be xterm, could be some other).
the terminal emulator draws character cells on a window
those cells form a grid; the window may extend beyond the grid
the window can have a background color
the grid can have a background color
within the grid, most terminals provide some capability of drawing text with specific foreground and background colors
the grid can have a default background color which is not any of the specified colors
outside the grid, the window can also have a default background color
normally, the grid- and window-default backgrounds are the same
the window can be resized to (more or less) arbitrary sizes
the grid is constrained to exact character sizes
because of this difference, the window can have areas outside the grid which use its default color, and not match the grid's background color.
escape sequences which could affect the grid- and window-background colors are doing erases (see for example the ncurses FAQ My terminal shows some uncolored spaces).
though it is conceivable that erasures within the grid could affect those outside areas, doing that generally leads to odd visual effects.

Use arbitrary colors in Vim and terminator

I am working on terminal Vim colorscheme (for 256-color terminal) and I need a few dark colours that I could use as backgrounds. I'm not satisfied with ones available in standard palette - for example, color 22 (#005f00), the darkest shade of green, is still too bright.
I've read that terminal Vim does not allow specifying colors as RGB, so - to get arbitrary colors - I would have to tweak terminal emulator's color palette. Is there a way to tweak full 256-color palette in gnome-terminal / terminator? Preferences window only allows editing basic 16.
BTW, Chrome's hterm allows this via 'color-palette-overrides' preference (but has its own drawbacks).
Gnome-terminal doesn't offer a UI to alter the colors (apart from the first 16), but you can use escape sequences, e.g.:
echo -ne '\e]4;22;#004f00\a'
As you've mentioned, sometimes these colors get reset to their default values. This was a bug in the underlying VTE library, and got fixed in version 0.36.
As far as I know, you won't find a single terminal emulator that gives you that kind of control over the whole standardized xterm palette.
So, if you ever intend to share that colorscheme you are stuck with the default palette.
On the other hand, if that colorscheme is only meant for your usage or if you are OK with forcing a hard dependency on your users, you can use japh's colorcoke to generate an alternate palette more suited to your needs. See the repo's wiki for examples)

Redhat Linux - change directory color

I am using Redhat Linux and the problem I am facing is that the "blue" colour of the directories is hardly visible on the black background. I found some posts on the web which asks to change some settings in the file /etc/profile.d/colorls.sh and /etc/profile.d/colorls.csh. However, this will change the colour settings for everyone who logs into the system. Could someone please let me know how I can change the colour settings that will affect only me?
To specify the colors of the output of ls, you need to set LS_COLORS. In your .zshrc, try adding:
LS_COLORS="$LS_COLORS:di=00;33"
34 is blue, 33 is ... yellowish. Change that number and find what you like.
Use dircolors to get a feel for what LS_COLORS should look like and add -p to see a color list.
Joachim's answer is good for fixing the specific issue of directories, but if any other utilities output using the "blue" color, you will find them just as unreadable.
Different terminal emulators have different settings for changing the colors; my terminal emulator of choice reads X resources to determine what colors to use:
URxvt.color0: #000000
URxvt.color1: #A80000
URxvt.color2: #00A800
URxvt.color3: #A8A800
URxvt.color4: #0000A8
URxvt.color5: #A800A8
URxvt.color6: #00A8A8
URxvt.color7: #A8A8A8
URxvt.color8: #000054
URxvt.color9: #FF0054
URxvt.color10: #00FF54
URxvt.color11: #FFFF54
URxvt.color12: #0000FF
URxvt.color13: #FF00FF
URxvt.color14: #00FFFF
URxvt.color15: #FFFFFF
color4 is the blue in question; I have mine set like this:
URxvt.background: #000000
URxvt.foreground: gray75
URxvt.color3: DarkGoldenrod
URxvt.color4: RoyalBlue
URxvt.color11: LightGoldenrod
URxvt.color12: LightSteelBlue
URxvt.color7: gray75
URxvt.colorBD: #ffffff
URxvt.colorUL: LightSlateGrey
URxvt.colorIT: SteelBlue
URxvt.cursorColor: grey90
URxvt.highlightColor: grey25
This gives a black background, not-too-bright foreground, and most other colors are reasonable enough. (I too found the default blue unreadable.) I put these into my ~/.Xresources file, and they take effect after log in or after merging this file with the X resources database: xrdb -merge ~/.Xresources.
Of course, different terminals are configured differently. Check your terminal's manpage for more details on changing the colors of the usual colors.
You can see what is done in the global file, and then add it to your private ~/.profile (or similar file.)
samolod solution is good.
In case of KDE konsole you go to
Settings -> Edit current profile -> Appearance -> Edit -> Color 5.
Then use graphical color chooser to make it brighter (I picked #5871FF).

Resources