OhMyREPL.jl icon indicating copy to clipboard operation
OhMyREPL.jl copied to clipboard

Update prompt.jl

Open eloualiche opened this issue 2 years ago • 7 comments

Allow for integer to call Base.text_colors to change the colors in the prompt.

I think this fixes some of the issues mentioned here: https://github.com/KristofferC/OhMyREPL.jl/issues/258

eloualiche avatar Feb 03 '22 17:02 eloualiche

Needs some kind of documentation for people to be able to use this.

KristofferC avatar Feb 04 '22 14:02 KristofferC

I added an example in the documentation; also I added the integer choice for output and fixed the type in the doc.

eloualiche avatar Feb 04 '22 22:02 eloualiche

Also I did not see a documentation for the color choices anywhere so I took a screenshot for each integer. I wonder where this could fit or whether this could be useful?

Screen Shot 2022-02-04 at 16 57 52

eloualiche avatar Feb 04 '22 22:02 eloualiche

doesn't the "number -> actual color on your screen" depend on your terminal's palette?

Moelf avatar Feb 07 '22 13:02 Moelf

Good question. My guess is that it depends to some extent to my palette. But tbh, I could not find any mention of using Base.text_colors anywhere. I just think it would nice to have it somewhere.

Here is the blurb:

dint = filter( p -> first(p) isa Int, Base.text_colors)
for (key, value) in dint
    print(value); print("▐"*string(key)); 
end

Btw, this is a little bit of a tangent and has nothing to do with the PR at this point.

eloualiche avatar Feb 07 '22 14:02 eloualiche

image

my suggestion is to not show this screenshot, it's not relevant to the API, basically we just need to tell users this is 256 color pallet in some terminal etc. (some terminals have true color support)

Moelf avatar Feb 07 '22 15:02 Moelf

I agree. I was merely asking if Julia should have this somewhere. I just could not see documentation for text_colors.

I guess this means we could converge on merging this.

eloualiche avatar Feb 07 '22 16:02 eloualiche

Thanks, and sorry for the very slow feedback here.

KristofferC avatar Mar 08 '23 10:03 KristofferC