Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: "color option ub doesn't seem to do anything though 👀" #414

Closed
cafkafk opened this issue Sep 24, 2023 · 12 comments · Fixed by #702
Closed

bug: "color option ub doesn't seem to do anything though 👀" #414

cafkafk opened this issue Sep 24, 2023 · 12 comments · Fixed by #702

Comments

@cafkafk
Copy link
Member

cafkafk commented Sep 24, 2023

Originally posted by @bew in #315 (comment)

I edited my theme to have distinct colors for file size of different magnitudes, by adding:

# Color file sizes by order of magnitude
EXA_COLORS+="nb=38;5;239:ub=38;5;241:"    #  0  -> <1KB : grey
EXA_COLORS+="nk=38;5;29:uk=38;5;100:"     # 1KB -> <1MB : green
EXA_COLORS+="nm=38;5;26:um=38;5;32:"      # 1MB -> <1GB : blue
EXA_COLORS+="ng=38;5;130:ug=38;5;166;1:"  # 1GB -> <1TB : orange
EXA_COLORS+="nt=38;5;160:ut=38;5;197;1:"  # 1TB -> +++  : red

Screenshot_20230924_135554

I think it looks pretty nice 😃 ✨

test files were created with truncate -s 123g 3_giga for example to simulate file sizes

color option ub doesn't seem to do anything though 👀

@bew
Copy link
Contributor

bew commented Sep 24, 2023

Hmm.. I'm not sure it's a bug, it's really that there is no unit name displayed and I'm not sure what it could be here..
It kind of makes sense that there is nothing displayed

@MartinFillon
Copy link
Contributor

After testing I agree with @bew this is not a bug just an unuseful feature for the moment as we never print a character under kb.

@MartinFillon MartinFillon closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2023
@bew
Copy link
Contributor

bew commented Oct 2, 2023

I'm thinking ub style option could actually be removed since it's basically useless at the moment, and can free up ub to be used for other things

@MartinFillon
Copy link
Contributor

thoughts about this @cafkafk @PThorpe92 @gierens ?

@MartinFillon MartinFillon reopened this Oct 2, 2023
@cafkafk
Copy link
Member Author

cafkafk commented Oct 2, 2023

I mean shouldn't it be fixed if it's supposed to work?

I don't really customize colors tbh so this is not a usecase I fully understand

@bew
Copy link
Contributor

bew commented Oct 2, 2023

I mean shouldn't it be fixed if it's supposed to work?

What would you display with ub's color?
There is no size unit displayed for size < 1k at the moment (which I think is okay), or are you thinking about some unit to show?

@cafkafk
Copy link
Member Author

cafkafk commented Oct 2, 2023

ahh I see, welp, guess it makes sense to remove it then

@MartinFillon
Copy link
Contributor

Just took a look into the code, I think I can liberate it, but it will have to stay in the code for some part because of how it was first deleopped

@samEngineering
Copy link

sn and sb are not working at all for me unfortunately :( They stay bold green no matter what I set them to. I tried setting all the individual range values for size and units (n* and u*) instead, but same result. I thought it might be grabbing the color of the last permission bit somehow, so I changed that but same deal. I even tried doing nothing but @cafkafk's bit by itself:

EXA_COLORS+="nb=38;5;239:ub=38;5;241:"    #  0  -> <1KB : grey
EXA_COLORS+="nk=38;5;29:uk=38;5;100:"     # 1KB -> <1MB : green
EXA_COLORS+="nm=38;5;26:um=38;5;32:"      # 1MB -> <1GB : blue
EXA_COLORS+="ng=38;5;130:ug=38;5;166;1:"  # 1GB -> <1TB : orange
EXA_COLORS+="nt=38;5;160:ut=38;5;197;1:"  # 1TB -> +++  : red

and exporting but still no change :( Is anyone else having this issue?
To reproduce, I am running eza --long --icons=always in a directory with files of nonzero size with the following config:

#! /usr/bin/env zsh

# ansi codes
bold=1
italic=3
black=30
red=31
green=32
yellow=33
blue=34
magenta=35
cyan=36
white=37
orange=93

declare -A eza_colors=(
   [ur]="${yellow}"
   [uw]="${magenta}"
   [ux]="${green}"
   [ue]="${green}"
   [uu]="${bold};${italic};${yellow}"
   [uR]="${bold};${italic};${red}"
   [sn]="${bold};${cyan}"
   [sb]="${bold};${cyan}"
   [di]="${bold};${blue}"
   [ln]="${bold};${cyan}"
   [lp]="${cyan}"
   [da]="${magenta}"
   [do]="${orange}"
   [co]="${red}"
   [bu]="${bold};${yellow}"
   [*.txt]="${white}"
   [*.lua]="${cyan}"
   [*.gitlab*]="${orange}"
)

EZA_COLORS=""

for x in ${(k)eza_colors}; do
   EZA_COLORS+=":${x}=${eza_colors[$x]}"
done

export EZA_COLORS="${EZA_COLORS:1}"
export EZA_ICON_SPACING=1

and this software:

>  eza --version           
eza - A modern, maintained replacement for ls
v0.16.0 [+git]
https://github.com/eza-community/eza

>  kitty --version   
kitty 0.31.0 created by Kovid Goyal

^_^

@MartinFillon
Copy link
Contributor

gonna look after this

@bew
Copy link
Contributor

bew commented Nov 23, 2023

@samEngineering @MartinFillon I opened #682, since 0.15.3 color tweaks of the file size stopped working

@bew
Copy link
Contributor

bew commented Nov 23, 2023

Just took a look into the code, I think I can liberate it, but it will have to stay in the code for some part because of how it was first deleopped

@cafkafk @MartinFillon regardless of the issue of file size tweaks not working anymore, what do you want to do with this issue, close as won't fix? or remove ub from the manpage at least maybe since it doesn't do anything?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants