diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2025-03-26 17:01:12 +0100 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2025-03-26 16:42:30 +0000 |
| commit | 805ddd0acc71e653d0f5f841e0ceaff665fce063 (patch) | |
| tree | 9e375a1b113407e2d54ecca363c05bc765040927 | |
| parent | 75b9d167825be0d6f22884ce4a8b8392bdd12d63 (diff) | |
pager: Also set SMK in LESS, fix LV=C to be LV=-c
Sync the LESS environment with systemd to make it more user-friendly
than just a blinking colon:
- S disables the terminal bell
- M makes the output verbose, so the prompt is not ":" but "lines 1-n"
- K means that Ctrl+c exits the command
Also fix the LV= environment variable to use -c and not C.
| -rw-r--r-- | CMakeLists.txt | 2 | ||||
| -rwxr-xr-x | test/integration/test-apt-cli-pager | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b0338e94..4db439d3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,7 +237,7 @@ set(BIN_DIR "${CMAKE_INSTALL_FULL_BINDIR}") # Setup the default pager and the environment set(DEFAULT_PAGER "pager" CACHE STRING "The default pager to use for commands that support it.") -set(PAGER_ENV "LESS=FRX\\nMORE=FRX\\nLV=C" CACHE STRING "Environment to pass to the pager. One variable per line, with escaped newlines") +set(PAGER_ENV "LESS=FRSXMK\\nMORE=FRX\\nLV=-c" CACHE STRING "Environment to pass to the pager. One variable per line, with escaped newlines") # Configure our configuration headers (config.h and apti18n.h) configure_file(CMake/config.h.in ${PROJECT_BINARY_DIR}/include/config.h) diff --git a/test/integration/test-apt-cli-pager b/test/integration/test-apt-cli-pager index cc220c81f..ffa4e828d 100755 --- a/test/integration/test-apt-cli-pager +++ b/test/integration/test-apt-cli-pager @@ -126,5 +126,5 @@ Checksums-Sha256: PAGER="head -2" testsuccessequal "Package: foo Binary: foo" runapt --unbuffer apt showsrc foo -o TestPager="head- 2" -PAGER='echo $LESS' testsuccessequal "FRX" runapt --unbuffer apt showsrc foo -o TestPager='echo $LESS (1)' +PAGER='echo $LESS' testsuccessequal "FRSXMK" runapt --unbuffer apt showsrc foo -o TestPager='echo $LESS (1)' LESS=FRXM PAGER='echo $LESS' testsuccessequal "FRXM" runapt --unbuffer apt showsrc foo -o TestPager='echo $LESS (2)' |
