Merge pull request #1593 from luukvbaal/preview-tui

Preview-tui hide terminated/broken pipe messages
This commit is contained in:
Arun 2023-02-20 19:42:15 +05:30 committed by GitHub
commit 9503703517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -146,10 +146,20 @@ for env in $ENVVARS; do
esac
done; unset IFS
trap '' PIPE
exists() { type "$1" >/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" ;}
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() {
case "$NNN_TERMINAL" in