eza icon indicating copy to clipboard operation
eza copied to clipboard

feat: pagination

Open flexyboooy opened this issue 1 year ago • 8 comments

Am I too stoned rn or is eza missing a feature for output pagination?

Sure, I could pipe (huh huh) to e.g. less, but then I lose all the pretty colours, don't I?

Certainly not a priority but would be dang useful when listing subdirectories ...

flexyboooy avatar Dec 30 '23 18:12 flexyboooy

what do you mean by pagination, could you please provide some examples so that we can think about it

MartinFillon avatar Jan 02 '24 20:01 MartinFillon

Like what less does

rsholmes avatar Jan 03 '24 18:01 rsholmes

Well this could be an idea to implement. We need to have a deeper look at this

MartinFillon avatar Jan 13 '24 11:01 MartinFillon

I wondered about this too. It looks as if you can already keep the pretty colors if you do

eza --color=always | less -R

ashmanskas avatar Feb 13 '24 22:02 ashmanskas

bat does this and I quite like it, it's definitely worth considering.

daviessm avatar Feb 14 '24 10:02 daviessm

This would be really nice. Like @ashmanskas wrote, this is already possible but the -G (grid) flag doesn't really work when piped into less unless you supply a --width value.

Workaround for this is doing something like this:

eza --color=always --grid --width $COLUMNS | less -FRi
(took the liberty of using F to exit if pagination is not needed and i for ignoring case when searching within less)

RedSnt avatar Sep 01 '24 07:09 RedSnt

I don't think we should ever default to pagination, but we could have something like bat's --pager --paging and such, I think there is also a relevant environment variable for setting a pager.

We shouldn't implement an actual pager ourselves thou, just the ability to work with one.

I think it would be nice to just start simply with a --paging flag that sends the output of eza into a pager, then expand to auto/always/never (making no arg default to always) to page contextually, based on if we'd use more lines than the terminal currently has, then we can look into --pager <pager> or some PAGER or EZA_PAGER that takes precedence over the system pager (we should ensure that the PAGER var is common).

That is also to say, one PR at a time, building out this system may be overwhelming if done in one large PR!

cafkafk avatar Sep 01 '24 09:09 cafkafk

I don't think we should ever default to pagination

Well, unless we have something like e.g. a config file to set it of course... but again, let's start with the simple case :p

cafkafk avatar Sep 01 '24 09:09 cafkafk

eza --color=always --grid --width $COLUMNS | less -FRi

sad that it doesn't work with --icons (at least on my machine)

skewb1k avatar Oct 22 '24 22:10 skewb1k

(that's an issue with less, not eza)

cafkafk avatar Oct 25 '24 13:10 cafkafk