leo-arch / clifm

The shell-like, command line terminal file manager: simple, fast, extensible, and lightweight as hell.
https://github.com/leo-arch/clifm/wiki
GNU General Public License v2.0
1.33k stars 40 forks source link

a few pager problems #129

Open deathtrip opened 2 years ago

deathtrip commented 2 years ago

Describe the bug

  1. In kitty, only the bottom row is visible while in the pager, the rest of the screen is black. Alacritty and WezTerm work fine, so not sure if it's kitty's or clifm's problem.
  2. Mouse scrolling doesn't work when in the pager, only when you exit it, you can scroll a bit upward.
  3. You cannot switch workspaces while in the pager.
  4. When you re-enter a workspace, you automatically get put back into the pager, even if you previously scrolled to the bottom and were back in the cli.

Expected behavior

  1. Mouse scrolling should work just like when not using the pager.
  2. Workspaces should be switchable while in the pager.
  3. When the user re-enters a workspace, continue where they left off, either in the cli or the pager.

Desktop:

leo-arch commented 2 years ago

Hi @deathtrip. Thanks for reporting. I'll take a look at it.

The built-in pager (Mas) is very basic, true. Maybe writing a plugin, using a full-blown pager like less, could be a good idea.

deathtrip commented 2 years ago

Seems like a good idea. Using an external pager would certainly mean less code to maintain.

leo-arch commented 2 years ago

Well, I wrote a simple plugin to pipe the current list of files through a pager (either $PAGER or less). It's bound to the gg action.

To use the plugin you can either remove/rename your actions file ($HOME/.config/clifm/plugins/actions.cfm), in which case it will be regenerated by CliFM on startup, or add the line yourself using the actions edit command:

gg=pager.sh

For the time being, it only does this, paging files, though it solves all the problems you highlighted (except 3: switching workspaces while in the pager). Give it a try and let me know what you think.

deathtrip commented 2 years ago

Just tried it and as you said it solves three of the four problems. Could you make it an option to use the plugin as the default pager?

leo-arch commented 2 years ago

Just need to figure out the best way to implement this, namely, setting a plugin as default pager. I'll let you know.

leo-arch commented 2 weeks ago

Hey @deathtrip, I've been revisiting this issue: as far as I can tell, 3/4 issues you describe are now solved using clifm's native pager:

  1. The pager properly display all rows in Kitty.
  2. Mouse scrolling does work.
  3. The pager (if invoked via Alt-0 or the pg command), is not reexecuted when changing directory/workspace or updating the current list of files. By default, it runs only once.

However, switching workspaces while in the pager isn't possible yet.