[GH-ISSUE #3607] Pagination suggestion #2474

Open
opened 2026-02-27 00:53:09 +03:00 by kerem · 0 comments
Owner

Originally created by @zxdong262 on GitHub (Sep 20, 2024).
Original GitHub issue: https://github.com/electerm/electerm/issues/3607

Hello!

  1. It might be nice to have a "show all" pagination option. Sometimes it might be necessary.

  2. Although pagination displays page by page, it seems to request the entire list of folders at once. Maybe it would be nice to get a limited number of folders (not all at once)?
    The idea with pagination is good, but when you have thousands of files/folders, pagination takes an unrealistically long time to load. Can you try to get the number of files/folders (wc -l), and then get a limited number of files/folders in this list?

pagination command like: ls -la | head - {$page*$count+1} | tail -n {$count}
where +1 = total rows

for first page: ls -la | head - 6 | tail -n 5
for second page: ls -la | head - 11 | tail -n 5
for third page: ls -la | head - 16 | tail -n 5
it is very fast!

-bash-4.2$ ls | wc -l
508030
-bash-4.2$ ls -la | head -6 | tail -n 5
drwxr-xr-x 491422 www-data tape 13361152 Sep 20 04:02 .
drwxrwxr-x 25 www-data tape 4096 May 30 07:25 ..
drwxrwxr-x 2 www-data tape 187 Aug 21 07:45 1
drwxrwxr-x 2 www-data tape 187 Jun 6 2023 10
drwxrwxr-x 2 www-data tape 4096 Jan 31 2024 100007
-bash-4.2$ ls -la | head -11 | tail -n 5
drwxrwxr-x 2 www-data tape 6 Jul 2 06:45 100021
drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100022
drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100031
drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100032
drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100033
-bash-4.2$ ls -la | head -16 | tail -n 5
drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100034
drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100035
drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100036
drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100037
drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100044

Originally posted by @AASabancev in https://github.com/electerm/electerm/discussions/3605

Originally created by @zxdong262 on GitHub (Sep 20, 2024). Original GitHub issue: https://github.com/electerm/electerm/issues/3607 Hello! 1. It might be nice to have a "show all" pagination option. Sometimes it might be necessary. 2. Although pagination displays page by page, it seems to request the entire list of folders at once. Maybe it would be nice to get a limited number of folders (not all at once)? The idea with pagination is good, but when you have thousands of files/folders, pagination takes an unrealistically long time to load. Can you try to get the number of files/folders (wc -l), and then get a limited number of files/folders in this list? pagination command like: ls -la | head - {$page*$count+1} | tail -n {$count} where +1 = total rows for first page: ls -la | head - 6 | tail -n 5 for second page: ls -la | head - 11 | tail -n 5 for third page: ls -la | head - 16 | tail -n 5 it is very fast! -bash-4.2$ ls | wc -l 508030 -bash-4.2$ ls -la | head -6 | tail -n 5 drwxr-xr-x 491422 www-data tape 13361152 Sep 20 04:02 . drwxrwxr-x 25 www-data tape 4096 May 30 07:25 .. drwxrwxr-x 2 www-data tape 187 Aug 21 07:45 1 drwxrwxr-x 2 www-data tape 187 Jun 6 2023 10 drwxrwxr-x 2 www-data tape 4096 Jan 31 2024 100007 -bash-4.2$ ls -la | head -11 | tail -n 5 drwxrwxr-x 2 www-data tape 6 Jul 2 06:45 100021 drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100022 drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100031 drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100032 drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100033 -bash-4.2$ ls -la | head -16 | tail -n 5 drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100034 drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100035 drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100036 drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100037 drwxrwxr-x 2 www-data tape 187 Jun 6 2023 100044 _Originally posted by @AASabancev in https://github.com/electerm/electerm/discussions/3605_
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/electerm#2474
No description provided.