exa icon indicating copy to clipboard operation
exa copied to clipboard

-G doesn't work after #988

Open folknor opened this issue 2 years ago • 13 comments

Compiling exa from the latest git commit no longer produces the correct output with -G, --grid.

Previously it listed folders like this (mockup):

foo    bar    baz   etc
dev   bin

Now the same folders would be listed like this:

foo
bar
baz
etc
dev
bin

folknor avatar Dec 12 '21 10:12 folknor

exa -G -l seems to work as expected.

folknor avatar Dec 12 '21 10:12 folknor

Err.. it works in some folders but not others. What on earth is going on?

folknor avatar Dec 13 '21 16:12 folknor

Putting the link to the faulty PR here: #988

It’s weird, can you give me an example of an exact configuration that fails for you, so that I can reproduce?

ariasuni avatar Dec 13 '21 19:12 ariasuni

Turns out that was easy.

  1. Create an empty folder and cd in
  2. Create 3-10 empty folders inside it
  3. Run exa -G and note that they display like they should
  4. Resize window so the horizontal grid won't fit
  5. Run exa -G exa

folknor avatar Dec 13 '21 19:12 folknor

I can confirm the exact same behaviour for me

alexcoder04 avatar Dec 13 '21 20:12 alexcoder04

I have the same issue, -G option does not work.

ericuni avatar Dec 17 '21 01:12 ericuni

I have the same issue if used with --icons, but it works when I increase my font size

Original font size Original font size

Increased font size Increased font size

fitrh avatar Dec 18 '21 07:12 fitrh

with the help of git bisect, I think the first bad commit is af20828

SIGSTACKFAULT avatar Dec 23 '21 18:12 SIGSTACKFAULT

Works on my machine, whatever font size I use

exa-no-bug

Maybe a terminal difference?

Eijebong avatar Dec 24 '21 16:12 Eijebong

The bug is definitely there, but it depends on either

  • Font size
  • Number of entries in folder
  • Terminal

Or a combination. I just tested it in a folder with 100 entries and it works then, but in a folder with 22 entries it does not work. Using gnome-terminal. EDIT: But if you look a firths screenshot in https://github.com/ogham/exa/issues/990#issuecomment-997161947 it certainly looks like he has more than 100 entries there (though I haven't counted.)

folknor avatar Dec 24 '21 18:12 folknor

I’m pretty sure term_grid new version just miscalculates something. Your 100+ entries directory where it fails aren’t very useful to find the bug; an even simpler example than what @folknor has found could be helpful.

I’ll have a look at it and if it’s too complicated or whatever I’ll simply revert the term_grid upgrade.

ariasuni avatar Dec 26 '21 16:12 ariasuni

Not sure it is related, but I was trying to generate a grid in the pager, and miserably failing:

  • I expected to be able to obtain a grid tweeking the number of columns, but I get:

    ❯ env COLUMNS=30 exa | less -R
    Cargo.toml
    notes
    README.md
    src
    tags
    

    same result with whatever number of columns (tested with 1000 as well).

  • While specifying the across flag I actually get the grid

    ❯ env COLUMNS=30 exa -x | less -R
    Cargo.toml  notes  README.md
    src         tags
    
  • Instead, autodetecting the size of the terminal just works fine...

    ❯ exa  # in a very narrow terminal
    Cargo.toml  README.md  tags
    notes       src
    

If I'm making a very stupid mistake I'd be glad to receive the explanation or being redirected...

alecandido avatar Jan 06 '23 15:01 alecandido

It just seems to randomly happen sometimes. Downgrade to v0.10.0 and it works like a charm

ginkcode avatar Feb 08 '23 09:02 ginkcode