Control: reassign -1 systemd
Control: tags -1 patch

Hi,

This is not bug of lv.
As Yoshihito 's have pointed out , this is due to that it does not
contain lv to pager implementation of systemd.

I reassign this bug to systemd and attached patch to fix this problem.

Best regards,
  Nobuhiro

-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
From 17af75dd95fbdb56b5c8985553cd4343d98a3100 Mon Sep 17 00:00:00 2001
From: Nobuhiro Iwamatsu <iwama...@nigauri.org>
Date: Sun, 18 Sep 2016 01:23:47 +0900
Subject: [PATCH] Add support lv

Current of systemd only supports less and more as a pager.
This adds lv which is one of the pager.

Signed-off-by: Nobuhiro Iwamatsu <iwama...@nigauri.org>
---
 src/shared/pager.c | 30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/src/shared/pager.c b/src/shared/pager.c
index a2524d4..f57335a 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -89,7 +89,7 @@ int pager_open(bool no_pager, bool jump_to_end) {
 
         /* In the child start the pager */
         if (pager_pid == 0) {
-                const char* less_opts, *less_charset;
+                const char* pager_opts, *pager_charset;
 
                 (void) reset_all_signal_handlers();
                 (void) reset_signal_mask();
@@ -98,21 +98,28 @@ int pager_open(bool no_pager, bool jump_to_end) {
                 safe_close_pair(fd);
 
                 /* Initialize a good set of less options */
-                less_opts = getenv("SYSTEMD_LESS");
-                if (!less_opts)
-                        less_opts = "FRSXMK";
+                pager_opts = getenv("SYSTEMD_LESS");
+                if (!pager_opts)
+                        pager_opts = "FRSXMK";
                 if (jump_to_end)
-                        less_opts = strjoina(less_opts, " +G");
-                setenv("LESS", less_opts, 1);
+                        pager_opts = strjoina(pager_opts, " +G");
+                setenv("LESS", pager_opts, 1);
 
                 /* Initialize a good charset for less. This is
                  * particularly important if we output UTF-8
                  * characters. */
-                less_charset = getenv("SYSTEMD_LESSCHARSET");
-                if (!less_charset && is_locale_utf8())
-                        less_charset = "utf-8";
-                if (less_charset)
-                        setenv("LESSCHARSET", less_charset, 1);
+                pager_charset = getenv("SYSTEMD_LESSCHARSET");
+                if (!pager_charset && is_locale_utf8())
+                        pager_charset = "utf-8";
+                if (pager_charset)
+                        setenv("LESSCHARSET", pager_charset, 1);
+
+                /* Initialize a good set of lv options */
+                pager_opts = getenv("SYSTEMD_LV");
+                if (!pager_opts)
+                        pager_opts = "-c";
+                /* NOTE: lv does not support option of jump_to_end. */
+                setenv("LV", pager_opts, 1);
 
                 /* Make sure the pager goes away when the parent dies */
                 if (prctl(PR_SET_PDEATHSIG, SIGTERM) < 0)
@@ -138,6 +145,7 @@ int pager_open(bool no_pager, bool jump_to_end) {
 
                 execlp("less", "less", NULL);
                 execlp("more", "more", NULL);
+                execlp("lv", "lv", NULL);
 
                 pager_fallback();
                 /* not reached */
-- 
2.9.3

Reply via email to