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: with many files, the grid option doesn't work #799

Open
kiyoon opened this issue Jan 25, 2024 · 12 comments
Open

bug: with many files, the grid option doesn't work #799

kiyoon opened this issue Jan 25, 2024 · 12 comments
Labels
errors Something isn't working output

Comments

@kiyoon
Copy link

kiyoon commented Jan 25, 2024

  • The version of eza being used (eza --version): 0.17.2
  • The command-line arguments you are using: eza, eza --icons auto etc.
  • Your operating system and hardware platform: Ubuntu 20.04

Without the -1 option it still prints every file per line. All of the file names are shown as such, with 4 character codes.

image

@kiyoon kiyoon added the errors Something isn't working label Jan 25, 2024
@PThorpe92
Copy link
Member

Hey thanks for reporting the issue. A couple questions,

Could you list out the rest of the exact arguments you are using?

how many files in a directory is "many", and the same args in a smaller directory is producing different output?

All of the file names are shown as such, with 4 character codes.

Do you mean that those aren't the file names?

Trying to re-create this issue, so as much info as you can give would be helpful 👍

@kiyoon
Copy link
Author

kiyoon commented Jan 26, 2024

@PThorpe92 No argument was needed to reproduce this. It works like this with whatever I use, with or without --icons for example. With exa the grid works well.

This was enough to reproduce:

for a in {0001..0401}; do touch $a; done
eza --icons auto
  • With 400 files it works as expected, but not with 401 files.
  • Without --icons I needed to create more files, like 600 to reproduce. (don't know the exact boundary)
  • I'm using Wezterm ($TERM=wezterm) and I found out that with Gnome Terminal the issue doesn't exist.
  • The size of the terminal seems to matter. The issue exists with the terminal fit to full screen but not with smaller window.

@PThorpe92
Copy link
Member

Interesting how this doesn't reproduce in gnome. Thanks for the info I'll try to repro this as I use wezterm as well.

@kiyoon
Copy link
Author

kiyoon commented Jan 26, 2024

@PThorpe92 My theory is that there exist some edge cases where it doesn't align the grid, and maybe with gnome terminal if I had the exact same column it might happen too.

@PThorpe92
Copy link
Member

Strange, I expected to be able to reproduce this, as I have seen kind of random errors in the past with grid width. but I tried on Wez, alactritty, kitty, xfce-term and xterm on eza v0.17.3 and got the proper amt of columns every time, even at different window sizes.
Perhaps try upgrading to17.3 and see if that fixes it?

@kiyoon
Copy link
Author

kiyoon commented Jan 27, 2024

Thanks for the time to try many settings but I'm sorry you couldn't reproduce. I tried with the v0.17.3 but the issue still exists.

Additional info that may be helpful

$ tput cols
166

$ tput lines
34

It seems like the number of row doesn't matter, but the width matters. I tried with smaller font size and set the width to 166, and I can still reproduce it.

@kiyoon
Copy link
Author

kiyoon commented Jan 27, 2024

OK, with Gnome Terminal it happens exactly the same as Wezterm so it wasn't the issue with the terminal. My bad.

With width=166 you should be able to reproduce it.

@PThorpe92
Copy link
Member

Yeah after quite a bit of testing, I was able to reproduce it. Super strange, because the command that I use for my alias (alias ls="eza --icons --color-scale -lAh --git --git-repos --no-permissions --grid") will display properly, but eza --icons will not.

but eza --icons -lA --grid will display properly, however if you take away the -lA, --icons --grid will not...

Very strange indeed, especially because with cols at 158, and 176, it works as expected 😕

Looking into this 👍

@kiyoon
Copy link
Author

kiyoon commented Jan 30, 2024

That is really weird! But I'm glad you were able to reproduce it and I appreciate it for maintaining the awesome project 😄

@tertsdiepraam
Copy link
Contributor

I'm looking into this, it's a bug in uutils-term-grid. I've been able to reproduce it in the test suite there.

@tertsdiepraam
Copy link
Contributor

I've fixed this in uutils/uutils-term-grid#34, but we'll need to port eza to use the new version of uutils-term-grid to use the fix. It was a weird combination of small mistakes in the computation of some heuristics, which is why it was so sensitive to those specific values.

@kiyoon
Copy link
Author

kiyoon commented Feb 18, 2024

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
errors Something isn't working output
Projects
None yet
Development

No branches or pull requests

3 participants