From aa538820de986dceecb4407fa798d7cfc706f85e Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 17 Nov 2024 16:15:30 +0100 Subject: [PATCH] board/common: replace pager symlink with a tiny shell script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are basically the same flags as was passed to klish, but now we use -R instead of -r to make sure only ANSI coloĊ• escapes can affect the behavior of less. This change will make it posslbe to shop off too long lines and scroll vertically on really long lines instead for them breaking output. Signed-off-by: Joachim Wiberg --- board/common/rootfs/usr/bin/pager | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) mode change 120000 => 100755 board/common/rootfs/usr/bin/pager diff --git a/board/common/rootfs/usr/bin/pager b/board/common/rootfs/usr/bin/pager deleted file mode 120000 index 9ff82454..00000000 --- a/board/common/rootfs/usr/bin/pager +++ /dev/null @@ -1 +0,0 @@ -less \ No newline at end of file diff --git a/board/common/rootfs/usr/bin/pager b/board/common/rootfs/usr/bin/pager new file mode 100755 index 00000000..d307f92b --- /dev/null +++ b/board/common/rootfs/usr/bin/pager @@ -0,0 +1,13 @@ +#!/bin/sh +# -d ;; suppress error message "the terminal is dumb" +# -F :: exit if the entire file can be displayed on the first screen +# -I :: Ignore case, even for patterns +# -K :: exit immediately when an interrupt character (usually ^C) is typed +# -R :: Almost raw control charachters, only ANSI color escape sequences and +# OSC 8 hyperlink sequences are output. Allows veritcal scrolling +# -S :: lines longer than the screen width are chopped (truncated), not wrapped +# -X :: No termcap initialization and deinitialization set to the terminal. +# This is what leaves the contents of the output on screen. + +export LESS="-P %f (press h for help or q to quit)" +less -RISKd -FX "$@"