eza-community / eza

A modern alternative to ls
https://eza.rocks
European Union Public License 1.2
12.65k stars 220 forks source link

bug: --grid incorrect alignement when using --icons #617

Closed plescornet closed 1 year ago

plescornet commented 1 year ago

Hi !

When I use the --grid and --icons option with eza, the alignement does not seem to count special characters, such as accents éà..., resulting in misalignements. There is no such misalignements without --icons. For example :

eza --grid --icons
 agenda.txt                essay_réflexion.doc        meeting_notes.txt       presentation_été.ppt   résumé.doc                        travel_journal.txt
 bill_facture.pdf          family_photo.jpg            newsletter.txt          project_élève.docx     résumé_professionnel.doc          vacation_photo.jpeg
 brochure_été2023.pdf    important_文件.doc        notes_de_musique.txt    receipt_reçu.pdf        résumé_étudiant.doc              vacation_plan.pdf
 budget.xls                important_文檔.doc        painting_peinture.jpg   recipe_œufs.doc         schedule.txt                        éclair_recipe.pdf
 café_menu.docx           invitation_party.doc        party_invitation.doc    recipe_麵.doc           selfie.jpg
 contact_list.txt          invoice_2023.pdf            photo.jpg               report_projet.docx       shopping_list.txt
 contract_étranger.docx   letter_to_professeur.docx   photo_vacances.jpg      report_étude.pdf        song.mp3
 diary_journal.txt         letter_to_élève.doc       poem_poésie.txt        report_été2023.doc     spreadsheet_feuille_de_calcul.xls
 document.txt              map.png                     presentation.ppt        resume_cv.doc            ticket_entrée.pdf
eza --grid
agenda.txt              essay_réflexion.doc        meeting_notes.txt      presentation_été.ppt  résumé.doc                         travel_journal.txt
bill_facture.pdf        family_photo.jpg           newsletter.txt         project_élève.docx    résumé_professionnel.doc           vacation_photo.jpeg
brochure_été2023.pdf    important_文件.doc         notes_de_musique.txt   receipt_reçu.pdf      résumé_étudiant.doc                vacation_plan.pdf
budget.xls              important_文檔.doc         painting_peinture.jpg  recipe_œufs.doc       schedule.txt                       éclair_recipe.pdf
café_menu.docx          invitation_party.doc       party_invitation.doc   recipe_麵.doc         selfie.jpg
contact_list.txt        invoice_2023.pdf           photo.jpg              report_projet.docx    shopping_list.txt
contract_étranger.docx  letter_to_professeur.docx  photo_vacances.jpg     report_étude.pdf      song.mp3
diary_journal.txt       letter_to_élève.doc        poem_poésie.txt        report_été2023.doc    spreadsheet_feuille_de_calcul.xls
document.txt            map.png                    presentation.ppt       resume_cv.doc         ticket_entrée.pdf

Thanks for your work, eza is a very neat tool !

plescornet commented 1 year ago

Wait, does this only happend when using --grid and --icons together? Or does this also happen with just --grid?

Yes, no misalignement without --icons

gierens commented 1 year ago

I think the accents are not the problem but the icons. Can you upload a screenshot of both cases?

plescornet commented 1 year ago

I thought so at first, but same icons yield different alignement. Here's a screenshot ! Capture d'écran 2023-11-06 111039

plescornet commented 1 year ago

Does not seem to come from my font : last screenshot was with a non-Mono font "FiraCode Nerd Font", but I have the same misalignement with "FiraCode Nerd Font Mono".

Capture d'écran 2023-11-06 111836

ghost commented 1 year ago

Same bug as https://github.com/eza-community/eza/issues/566 ?

plescornet commented 1 year ago

Yes, seems to be the same bug. Should I close this one ?

PThorpe92 commented 1 year ago

This is an ongoing issue that we are working on right now. I have a draft of the fix that still has some bugs to work out, it involves a migration to a new major version of the uutils_term_grid dependency, and that just turned out to be a little tricky as it involves a fairly substantial rewrite of some calculations. But when it is finished, we shouldn't be having any more issues because the shaky way that things are calculated presently will no longer be :D Hopefully this gets solved by the next release :+1:

Closing, as this is indeed the same as #556

plescornet commented 10 months ago

Fixed in https://github.com/eza-community/eza/releases/tag/v0.17.1 : thanks !