[systemd-devel] [PATCH] pager: remove --no-init setting from LESS options

Jason A. Donenfeld Jason at zx2c4.com
Mon Feb 10 20:55:41 PST 2014


I use konsole. It has a nice feature that when the scrollbars have been
disabled -- like in the case of a full-console app like vim or less --
it makes the mouse wheel send up and down key strokes, so that
scrolling happens. It's really nice. I open up less, and then I can
scroll through it using the mouse wheel.

This doesn't work with systemd's pager, however, because systemd passes
--no-init to less. This patch removes this "X" flag.
---
 src/shared/pager.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/shared/pager.c b/src/shared/pager.c
index 72a29f2..2155713 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -89,9 +89,9 @@ int pager_open(bool jump_to_end) {
                 close_pipe(fd);
 
                 if (jump_to_end)
-                        setenv("LESS", "FRSXMK+G", 1);
+                        setenv("LESS", "FRSMK+G", 1);
                 else
-                        setenv("LESS", "FRSXMK", 1);
+                        setenv("LESS", "FRSMK", 1);
 
                 /* Make sure the pager goes away when the parent dies */
                 if (prctl(PR_SET_PDEATHSIG, SIGTERM) < 0)
-- 
1.8.5.3



More information about the systemd-devel mailing list