summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-06-28 22:36:43 +0200
committerLudovic Courtès <ludo@gnu.org>2020-06-28 23:26:53 +0200
commit1acc5e11beb1b8eea9fe931455bf2c9a26a69aa3 (patch)
tree4a40b1f01cbfc42669872c10af89ee2bebb77efa
parente1f2f3df84ecdff2b0f67d49ecb667d8c4a1ee26 (diff)
downloadguix-1acc5e11beb1b8eea9fe931455bf2c9a26a69aa3.tar.gz
processes: Write to $PAGER.
* guix/ui.scm (with-paginated-output-port): Export.
* guix/scripts/processes.scm (guix-processes): Use it instead of writing
directly to (current-output-port).
-rw-r--r--guix/scripts/processes.scm11
-rw-r--r--guix/ui.scm1
2 files changed, 7 insertions, 5 deletions
diff --git a/guix/scripts/processes.scm b/guix/scripts/processes.scm
index a2ab017490..01f7213e8c 100644
--- a/guix/scripts/processes.scm
+++ b/guix/scripts/processes.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -231,7 +231,8 @@ List the current Guix sessions and their processes."))
                 cons
                 '()))
 
-  (for-each (lambda (session)
-              (daemon-session->recutils session (current-output-port))
-              (newline))
-            (daemon-sessions)))
+  (with-paginated-output-port port
+    (for-each (lambda (session)
+                (daemon-session->recutils session port)
+                (newline port))
+              (daemon-sessions))))
diff --git a/guix/ui.scm b/guix/ui.scm
index 0d3620f96f..d64bb68f05 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -121,6 +121,7 @@
             file-hyperlink
             location->hyperlink
 
+            with-paginated-output-port
             relevance
             package-relevance
             display-search-results