Re: possible bugs with colored-stats

2020-10-29 Thread Chet Ramey
On 10/29/20 6:38 AM, Arnaud wrote:
> Le 29.10.20 à 06:54, Clark Wang a écrit :
>>
>> I can reproduce the similar issue with my bash 4.4.12 and PS0="\[\e[0m\]"
>> fix it for me.
>>
>> -clark
>>
> 
> I had to change at one point the PS0="\[\e[0m\] to PS0="\[\e[38;5;15m\].

Except for this changing the default color to light grey, which I have
trouble seeing, everything looks fine.

I'm testing on macOS Terminal.

If you want to look further, my guess is that the terminal is still using
the PS1 color when it prints the colored possible completions, and
reverting to the "normal" color after printing each possible completion
messes up the terminal's idea of the current color somehow.

Either way, the functions you want to look at are

colored_stat_start
colored_stat_end

which are called when the completion code prints colored possible
completions.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



Re: possible bugs with colored-stats

2020-10-29 Thread Arnaud
Le 29.10.20 à 06:54, Clark Wang a écrit :
> 
> I can reproduce the similar issue with my bash 4.4.12 and PS0="\[\e[0m\]"
> fix it for me.
> 
> -clark
> 

I had to change at one point the PS0="\[\e[0m\] to PS0="\[\e[38;5;15m\].

I tried again, it shows correctly the output of a command (grey is ok for me 
instead of white for 1st problem)
but still shows the 1st file with the color of the command input with tab 
completion (2nd problem I have).

It does it with bash 4.4-rc2, bash 5.0.18 and bash 5.1-rc1 on my system (fedora 
33).
I will try to look further in readline, to at least understand better.

Thanks


OpenPGP_0xEA0DA251B671CC2A.asc
Description: application/pgp-keys


OpenPGP_signature
Description: OpenPGP digital signature


Re: possible bugs with colored-stats

2020-10-28 Thread Clark Wang
On Thu, Oct 29, 2020 at 4:11 AM Arnaud  wrote:

>
> Description:
> I have colored my prompt with colors, using PS1 and PS0.
>
> PS1 ends with a color definition, so the command entered is
> colored.
> PS0 resets the color so the output has the standard colors.
> I have actived colored-stats, so when I use tab completion, the
> colors I use in the command doesn't show in the tab completion.
>
> Problem 1
> If the list starts with a file, only the 1st file is colored with
> the PS1 color.
> If the list starts with a folder, the colors are ok.
>
> Problem 2
> when I list the content of a folder with ls, the color is ok
> (white in my case, until I reach a folder,
> it then switches the color of the following files to grey.
>
> I tried looking in the bash code to try to find the problem, but I
> cannot locate the part of the code for that (not experienced in C)
> Normally, readline should be the part I am looking for, but I also
> have readline installed in my system, so it should be in it?
> (tried to remove the readline package in my system to be sure, but
> it wants to remove systemd, so I didn't)
>
> it seems to also do this with 5.1-rc1
>
> Repeat-By:
> add "set colored-stats on" in ~/.inputrc (may need to restart the
> shell)
> add at the end of PS1: "(\[\€[38;5;220m\]" , for example
> add for PS0: "\[\e[38;5;15m\]"
>

I can reproduce the similar issue with my bash 4.4.12 and PS0="\[\e[0m\]"
fix it for me.

-clark


Re: possible bugs with colored-stats

2020-10-28 Thread Chet Ramey
On 10/28/20 4:10 PM, Arnaud wrote:

> Bash Version: 5.0
> Patch Level: 17
> Release Status: release
> 
> Description:
> I have colored my prompt with colors, using PS1 and PS0.
> 
> PS1 ends with a color definition, so the command entered is colored.
> PS0 resets the color so the output has the standard colors.

I'm not sure what terminal emulator you're using, but that PS0 is what
turns the `normal' color to light grey on mine. It's pretty tough to see.

> I have actived colored-stats, so when I use tab completion, the 
> colors I use in the command doesn't show in the tab completion.
> 
> Problem 1
> If the list starts with a file, only the 1st file is colored with the 
> PS1 color.
> If the list starts with a folder, the colors are ok.

I can't reproduce this.

> Problem 2
> when I list the content of a folder with ls, the color is ok (white 
> in my case, until I reach a folder,
> it then switches the color of the following files to grey.

Nor this.

> 
> I tried looking in the bash code to try to find the problem, but I 
> cannot locate the part of the code for that (not experienced in C)
> Normally, readline should be the part I am looking for, but I also 
> have readline installed in my system, so it should be in it?

This is part of readline, yes.


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



possible bugs with colored-stats

2020-10-28 Thread Arnaud
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -O2 -flto -ffat-lto-objects -fexceptions -g 
-grecord-gcc-switches -pipe -Wall -Werror=format-security 
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS 
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong 
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -mtune=generic 
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection 
-Wno-parentheses -Wno-format-security
uname output: Linux localhost.localdomain 5.9.1-300.fc33.x86_64 #1 SMP Fri Oct 
23 11:58:21 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-redhat-linux-gnu

Bash Version: 5.0
Patch Level: 17
Release Status: release

Description:
I have colored my prompt with colors, using PS1 and PS0.

PS1 ends with a color definition, so the command entered is colored.
PS0 resets the color so the output has the standard colors.
I have actived colored-stats, so when I use tab completion, the colors 
I use in the command doesn't show in the tab completion.

Problem 1
If the list starts with a file, only the 1st file is colored with the 
PS1 color.
If the list starts with a folder, the colors are ok.

Problem 2
when I list the content of a folder with ls, the color is ok (white in 
my case, until I reach a folder,
it then switches the color of the following files to grey.

I tried looking in the bash code to try to find the problem, but I 
cannot locate the part of the code for that (not experienced in C)
Normally, readline should be the part I am looking for, but I also have 
readline installed in my system, so it should be in it?
(tried to remove the readline package in my system to be sure, but it 
wants to remove systemd, so I didn't)

it seems to also do this with 5.1-rc1

Repeat-By:
add "set colored-stats on" in ~/.inputrc (may need to restart the shell)
add at the end of PS1: "(\[\€[38;5;220m\]" , for example
add for PS0: "\[\e[38;5;15m\]"

(I tried to send it with bashbug on my system, but I didn't see it coming in 
the list, so sending it again)


OpenPGP_0xEA0DA251B671CC2A.asc
Description: application/pgp-keys


OpenPGP_signature
Description: OpenPGP digital signature