use $PAGER instead of less directly
feat: use $PAGER instead of less directly by RTUnreal
This commit is contained in:
commit
d46777148e
2 changed files with 5 additions and 3 deletions
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
## nyx-tui - Version 1.2.1:
|
## nyx-tui - Version 1.2.1:
|
||||||
- Added better Readability for the Build log
|
- Added better Readability for the Build log
|
||||||
use `less` to make it easier to scroll through the log in the TUI
|
use $PAGER (or fallback: `less`) to make it easier to scroll through the log in the TUI
|
||||||
~ Thanks to *rtunreal*
|
~ Thanks to *RTUnreal*
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ nix_dir="@NIX_DIR@"
|
||||||
version="@VERSION@"
|
version="@VERSION@"
|
||||||
dialog_bin="${DIALOG_BIN:-@DIALOG_BIN@}"
|
dialog_bin="${DIALOG_BIN:-@DIALOG_BIN@}"
|
||||||
|
|
||||||
|
PAGER="${PAGER:=less}"
|
||||||
|
|
||||||
# Fallbacks if Nix didn't substitute
|
# Fallbacks if Nix didn't substitute
|
||||||
if [[ -z "${dialog_bin//@DIALOG_BIN@/}" ]]; then
|
if [[ -z "${dialog_bin//@DIALOG_BIN@/}" ]]; then
|
||||||
# If placeholder remained, try common defaults
|
# If placeholder remained, try common defaults
|
||||||
|
|
@ -226,7 +228,7 @@ action_view_logs() {
|
||||||
tmp="$(mktemp)"
|
tmp="$(mktemp)"
|
||||||
lastlog="$(find "$log_dir" -type f -name '*.log' -printf '%T@ %p\n' 2>/dev/null | sort -nr | awk 'NR==1{print $2}')"
|
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
|
if [[ -n "${lastlog:-}" && -f "$lastlog" ]]; then
|
||||||
less <"$lastlog"
|
$PAGER <"$lastlog"
|
||||||
else
|
else
|
||||||
d_msg "No logs found in ${log_dir}"
|
d_msg "No logs found in ${log_dir}"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue