feat: use $PAGER instead of less directly
This commit is contained in:
parent
f957837620
commit
a763c2256e
2 changed files with 5 additions and 3 deletions
|
|
@ -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*
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue