diff --git a/Current-Patch.md b/Current-Patch.md index d6254cc..9d4dc1b 100644 --- a/Current-Patch.md +++ b/Current-Patch.md @@ -11,7 +11,7 @@ ## nyx-tui - Version 1.2.1: - Added better Readability for the Build log - use `less` to make it easier to scroll through the log in the TUI - ~ Thanks to *rtunreal* + use $PAGER (or fallback: `less`) to make it easier to scroll through the log in the TUI + ~ Thanks to *RTUnreal* diff --git a/nyx/bash/nyx-tui.sh b/nyx/bash/nyx-tui.sh index d1d0944..7168503 100644 --- a/nyx/bash/nyx-tui.sh +++ b/nyx/bash/nyx-tui.sh @@ -16,6 +16,8 @@ nix_dir="@NIX_DIR@" version="@VERSION@" dialog_bin="${DIALOG_BIN:-@DIALOG_BIN@}" +PAGER="${PAGER:=less}" + # Fallbacks if Nix didn't substitute if [[ -z "${dialog_bin//@DIALOG_BIN@/}" ]]; then # If placeholder remained, try common defaults @@ -226,7 +228,7 @@ action_view_logs() { tmp="$(mktemp)" lastlog="$(find "$log_dir" -type f -name '*.log' -printf '%T@ %p\n' 2>/dev/null | sort -nr | awk 'NR==1{print $2}')" if [[ -n "${lastlog:-}" && -f "$lastlog" ]]; then - less <"$lastlog" + $PAGER <"$lastlog" else d_msg "No logs found in ${log_dir}" fi