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

need help:mouse scroll and systemctl #2939

Closed
fr233 opened this issue Aug 27, 2020 · 10 comments
Closed

need help:mouse scroll and systemctl #2939

fr233 opened this issue Aug 27, 2020 · 10 comments

Comments

@fr233
Copy link

fr233 commented Aug 27, 2020

I have set
PAGER=less --mouse
so that i can scroll down with mouse in
$ systemctl list-unit-files (or other systemd command line tools)

that works with gnome-terminal / xterm / xfce-terminal / konsole / ....
,
but I notice that didn't work with kitty.

I then set
PAGER=most
, now mouse scroll down works again.

Is it a problem of less ? or systemd ? or kitty ?
how to solve this problem? thanks.

@kovidgoyal
Copy link
Owner

Works fine for me both with --mouse and without, using

less --mouse setup.py

or

less setup.py

in the latter case kitty will send arrow key events, in the former it
will use whatever mouse reporting mode less asks for.

less version 551
kitty version 0.18.3

@fr233
Copy link
Author

fr233 commented Aug 27, 2020

Works fine for me both with --mouse and without, using

less --mouse setup.py

or

less setup.py

in the latter case kitty will send arrow key events, in the former it
will use whatever mouse reporting mode less asks for.

less version 551
kitty version 0.18.3

try $ systemctl -list-unit-files, that phenomenon only appears in command line tools of systemd

@trygveaa
Copy link
Sponsor Contributor

This is caused by kitty only sending scroll events to the application when the alternate screen is active.

You can set the environment variable SYSTEMD_LESS to something not including X to use the alternate screen (the default is FRSXMK, so e.g. export SYSTEMD_LESS='FRSMK')

@kovidgoyal
Copy link
Owner

Then you should report the issue to them. They probably do some hackery
based on TERM variables. All I can tell you is kitty's
mouse protocol works fine, as evidenced by using less --mouse directly.

@fr233
Copy link
Author

fr233 commented Aug 27, 2020

This is caused by kitty only sending scroll events to the application when the alternate screen is active.

You can set the environment variable SYSTEMD_LESS to something not including X to use the alternate screen (the default is FRSXMK, so e.g. export SYSTEMD_LESS='FRSMK')

thanks.
Is this a design decison?

@fr233
Copy link
Author

fr233 commented Aug 27, 2020

Then you should report the issue to them. They probably do some hackery
based on TERM variables. All I can tell you is kitty's
mouse protocol works fine, as evidenced by using less --mouse directly.

yes.

@kovidgoyal
Copy link
Owner

wheel mouse events are used to scroll the scrollback buffer when not using the alternate screen.

@fr233
Copy link
Author

fr233 commented Aug 27, 2020

wheel mouse events are used to scroll the scrollback buffer when not using the alternate screen.

Oh I see.

@fr233
Copy link
Author

fr233 commented Aug 27, 2020

I have tested your commit, It's works, but still a little mismatch with other terminals:

gnome-terminal:
$ less --mouse --wheel-lines=1 somefile # scroll once down 1 line

kitty:
$ less --mouse --wheel-lines=1 somefile # scroll once down 1 lines

but
gnome-terminal:
$ less -X --mouse --wheel-lines=1 somefile # scroll once down 1 lines

kitty:
$ less -X --mouse --wheel-lines=1 somefile # scroll once down 5 lines

@kovidgoyal
Copy link
Owner

Should be fine now.

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

3 participants