You are not logged in.

#1 2016-10-15 17:02:26

Scriptor
Member
Registered: 2011-01-16
Posts: 144

[SOLVED]URxvt 256 colors in zsh prompt

Hello,

I am desperately trying to use colors other than 0-15 in the zsh prompt while using the rxvt-unicode-patched package. I have searched over the internet for a solution without any solution. Here are the found solutions that I have tried :

solution1:

%{%F{19} [...] %f%}

solution2:

$(echo -e "\033[38;5;19m"

With that I have also tried this :

*color19: #abf64

and this

URxvt*color19: #abfe64 

The problem is that it only takes into account the default system colors. It seems to completely ignore the xresources file. The colors 0-15 are correctly taken into account.

Here are some more informations:

$TERM: rxvt-unicode-256colors

Thank you very much in advance smile

Last edited by Scriptor (2016-10-16 11:38:15)

Offline

#2 2016-10-15 20:42:19

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: [SOLVED]URxvt 256 colors in zsh prompt

Could you please give us some context? The colour codes/escape sequences on their own don't tell us much (except that for your solution 2, you're missing the trailing `m` to complete the escape sequence) - maybe your config is wrong elsewhere.

This perl script should print the 216 colour cube - if it works alright, your urxvt probably supports 256 colours just fine, and the issue is your zsh config:

#!/usr/bin/env perl
# don't mind the quadruple for loop - it's just for the looks - you'll see

for ($l = 0; $l <=3; $l+=3) {
        for ($b = 0; $b < 6; $b++) {
                for ($g = $l; $g < $l+3; $g++) {
                        for ($r = 0; $r < 6; $r++) {
                                $c = 16+($r*36)+($g*6)+$b;
                                printf("\e[%d;48;5;%dm %3d \e[0m", $l==3 ? 30 : 37, $c, $c);
                        }
                        print " ";
                }
                print "\n";
        }
        printf "\n";
}

Last edited by ayekat (2016-10-15 20:42:58)


pkgshackscfgblag

Offline

#3 2016-10-16 11:03:58

Scriptor
Member
Registered: 2011-01-16
Posts: 144

Re: [SOLVED]URxvt 256 colors in zsh prompt

Thank you very much for your quick response.

To be more precise, the problem is that it doesn't take into account the fact that, for example the color 19, has been defined in Xresources. It seems to only take into account the default system colors. For example, if I set the color 19 to a pink color, the result is still a blue color (the default color system I guess).

Thank you very much in advance

Offline

#4 2016-10-16 11:34:19

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: [SOLVED]URxvt 256 colors in zsh prompt

Scriptor wrote:

For example, if I set the color 19 to a pink color, the result is still a blue color (the default color system I guess).

Yes, colour 19 is a mid/dark blue. For pink, you'd need e.g. colour 200 (or similar - check the colour cube). Is there a reason why you want to change the upper 240 colours rather than use the ones that are already there?

Also, you can't change the upper 240 colours through Xresources:

urxvt(1) wrote:

COLOURS AND GRAPHICS

[...]

Together, all those colours implement the 88 (256) colour xterm colours. Only the first 16 can be changed using resources currently, the rest can only be changed via command sequences ("escape codes").

[...]

There is urxvt(7) for the more technical details, although I haven't found what escape sequences exactly are required to change the upper 240 colours (but even if, I would highly recommend against writing terminal-specific shell configuration).


pkgshackscfgblag

Offline

#5 2016-10-16 11:37:53

Scriptor
Member
Registered: 2011-01-16
Posts: 144

Re: [SOLVED]URxvt 256 colors in zsh prompt

Thank you very much, now I understand better. I guess that my research was then completely useless ^^. At least now I know.

Thanks again for your help.

Offline

Board footer

Powered by FluxBB