mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 13:26:37 +00:00
Preview-tui hide terminated/broken pipe messages
Fix #1583, close #1591
This commit is contained in:
parent
a4745272db
commit
675e50c941
|
@ -146,10 +146,20 @@ for env in $ENVVARS; do
|
||||||
esac
|
esac
|
||||||
done; unset IFS
|
done; unset IFS
|
||||||
|
|
||||||
|
trap '' PIPE
|
||||||
exists() { type "$1" >/dev/null 2>&1 ;}
|
exists() { type "$1" >/dev/null 2>&1 ;}
|
||||||
pkill() { command pkill "$@" >/dev/null 2>&1 ;}
|
pkill() { command pkill "$@" >/dev/null 2>&1 ;}
|
||||||
pidkill() { [ -f "$1" ] && kill "$(cat "$1" 2>/dev/null)" >/dev/null 2>&1 ;}
|
|
||||||
prompt() { printf "%b" "$@"; cfg=$(stty -g); stty raw -echo; head -c 1; stty "$cfg" ;}
|
prompt() { printf "%b" "$@"; cfg=$(stty -g); stty raw -echo; head -c 1; stty "$cfg" ;}
|
||||||
|
pidkill() {
|
||||||
|
if [ -f "$1" ]; then
|
||||||
|
PID="$(cat "$1" 2>/dev/null)" || return 1
|
||||||
|
kill "$PID" >/dev/null 2>&1
|
||||||
|
RET=$?
|
||||||
|
wait "$PID" 2>/dev/null
|
||||||
|
return $RET
|
||||||
|
fi
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
start_preview() {
|
start_preview() {
|
||||||
case "$NNN_TERMINAL" in
|
case "$NNN_TERMINAL" in
|
||||||
|
|
Loading…
Reference in a new issue