preview-tui: wait killed previewers (#632)

This commit is contained in:
lvgx 2020-06-04 04:53:04 +02:00 committed by GitHub
parent 7b606e0e29
commit 2acc7bd324
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,7 +52,7 @@ fifo_pager() {
} }
preview_file () { preview_file () {
kill %- %+ 2>/dev/null kill %- %+ 2>/dev/null && wait %- %+ 2>/dev/null
clear clear
encoding="$(file -Lb --mime-encoding -- "$1")" encoding="$(file -Lb --mime-encoding -- "$1")"
@ -60,7 +60,7 @@ preview_file () {
# Detect mime type # Detect mime type
mimetype="$(file -Lb --mime-type -- "$1")" mimetype="$(file -Lb --mime-type -- "$1")"
# Detect file extention - use if you need # Detect file extention
ext="${1##*.}" ext="${1##*.}"
if [ -n "$ext" ]; then if [ -n "$ext" ]; then
ext="$(printf "%s" "${ext}" | tr '[:upper:]' '[:lower:]')" ext="$(printf "%s" "${ext}" | tr '[:upper:]' '[:lower:]')"