aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@rak.ac>2019-07-16 20:25:27 -0400
committerSolderpunk <solderpunk@sdf.org>2019-08-31 10:32:30 +0000
commitbb23b1c3d1b8dd1121e197ba5889f7c65727bec8 (patch)
treecc3135189ce3dd9f415eee88d8289acc0fb9a85a
parentMerge /home/solderpunk/telem (diff)
Determine pager from PAGER environment variable
Signed-off-by: Solderpunk <solderpunk@sdf.org>
-rwxr-xr-xtelem.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/telem.lua b/telem.lua
index ddf967a..991544b 100755
--- a/telem.lua
+++ b/telem.lua
@@ -23,6 +23,10 @@ end
if not _EDITOR then
_EDITOR = "nano"
end
+_PAGER = os.getenv("PAGER")
+if not _PAGER then
+ _PAGER = "less"
+end
_COLOURS = {
red=31,
@@ -585,7 +589,7 @@ end
function do_type_whole()
local filename = os.tmpname()
do_type_savefile(filename)
- os.execute("less " .. filename)
+ os.execute(_PAGER .. " " .. filename)
file.delete(filename)
end