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

feat: pagination #751

Open
flexyboooy opened this issue Dec 30, 2023 · 10 comments
Open

feat: pagination #751

flexyboooy opened this issue Dec 30, 2023 · 10 comments

Comments

@flexyboooy
Copy link

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 ...

@MartinFillon
Copy link
Contributor

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

@rsholmes
Copy link

rsholmes commented Jan 3, 2024

Like what less does

@MartinFillon
Copy link
Contributor

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

@ashmanskas
Copy link

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

eza --color=always | less -R

@daviessm
Copy link
Contributor

daviessm commented Feb 14, 2024

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

@RedSnt
Copy link

RedSnt commented Sep 1, 2024

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)

@cafkafk
Copy link
Member

cafkafk commented Sep 1, 2024

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
Copy link
Member

cafkafk commented Sep 1, 2024

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

@skewb1k
Copy link

skewb1k commented Oct 22, 2024

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

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

@cafkafk
Copy link
Member

cafkafk commented Oct 25, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants