mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
preview-tabbed now kills lingering viewer
This commit is contained in:
parent
d11b07fd01
commit
858794fd27
|
@ -94,6 +94,12 @@ get_viewer_pid () {
|
|||
VIEWERPID="$(jobs -p %%)"
|
||||
}
|
||||
|
||||
kill_viewer () {
|
||||
if [ -n "$VIEWERPID" ] && jobs -p | grep "$VIEWERPID" ; then
|
||||
kill "$VIEWERPID"
|
||||
fi
|
||||
}
|
||||
|
||||
previewer_loop () {
|
||||
unset -v NNN_FIFO
|
||||
# mute from now
|
||||
|
@ -123,9 +129,7 @@ previewer_loop () {
|
|||
continue
|
||||
fi
|
||||
|
||||
if [ -n "$VIEWERPID" ] && jobs -p | grep "$VIEWERPID" ; then
|
||||
kill "$VIEWERPID"
|
||||
fi
|
||||
kill_viewer
|
||||
|
||||
MIME="$(file -b --mime-type "$FILE")"
|
||||
|
||||
|
@ -188,6 +192,7 @@ previewer_loop () {
|
|||
fi
|
||||
done
|
||||
kill "$TABBEDPID"
|
||||
kill_viewer
|
||||
}
|
||||
|
||||
if [ ! -r "$NNN_FIFO" ] ; then
|
||||
|
|
Loading…
Reference in a new issue