-
-
Notifications
You must be signed in to change notification settings - Fork 430
-
-
Notifications
You must be signed in to change notification settings - Fork 430
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
Weird grid alignment #145
Comments
Hi @petobens , Thanks for the report! This is absolutely not a feature... Can you give us the output of At the moment their is no way to customize the icons only for your binary but you can propose your icons to everyone by doing a PR, the R extension would be welcomed at least. |
I had hit this at times. I did some investigation and it feels like a bug in unicode width computation in |
It's curious because it doesn't seem to be related to a specific icon or a specific color and those are the two possible source of errors for the string length calculation used by Without a reproducible case, this will be complicated to fix. |
@petobens do you have any complex |
I just ran into this, and disabling some
I actually don't even know what dircolors is, just thought this would help. |
Thanks for the quick reply. AFAICT I only have this
I'm using lsd version
Are there plans to add a config file to customize such icons and also colors in general (beyond LS_COLORS)? |
Actually when I running
|
Yep, there is some ideas about it (#92) but nobody is working on it at the moment. |
I think the error is related to the way we calculate the visible width. It expect the same colors format but with the We must be able to handle all these formats and today it's not the case. The faulty code: fn get_visible_width(input: &str) -> usize {
let mut nb_invisible_char = 0;
for (idx, _) in input.match_indices("\u{1b}[38;5;" /* "\e[38;5;" */) {
let color_code = input.chars().skip(idx + 7);
let mut code_size = 0;
color_code
.skip_while(|x| {
code_size += 1;
char::is_numeric(*x)
})
.count();
nb_invisible_char += 6 + code_size; /* "\e[38;5;" + color number + "m" */
}
if nb_invisible_char > 0 {
// If no color have been set, the is no reset character.
nb_invisible_char += 3; /* "[0m" */
}
UnicodeWidthStr::width(input) - nb_invisible_char
} |
I have a possible patch (#151) but it needs some tests. Is it possible that someone with the bug try it locally in order to check if it work? I will try to write some regression tests when I have the time |
Thank you!
Great |
Hi! I've started using lsd today (great project BTW :) and noticed some strange alignment:
Is that a bug or a feature? I'm on arch using alacritty. Thanks in advance!
BTW: is possible to add custom icons? for instance I would like to have an icon for symlinked folders, R extension, etc. I can open a new issue for this
The text was updated successfully, but these errors were encountered: