mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 21:36:42 +00:00
Preview-tui avoid early exit after SIGWINCH
This commit is contained in:
parent
7f63bef4d6
commit
f8f6d6a482
|
@ -475,12 +475,14 @@ if [ "$PREVIEW_MODE" -eq 1 ] 2>/dev/null; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
preview_file "$PWD/$1"
|
preview_file "$PWD/$1"
|
||||||
preview_fifo &
|
preview_fifo & WAITPID=$!
|
||||||
printf "%s" "$!" > "$FIFOPID"
|
printf "%s" "$!" > "$FIFOPID"
|
||||||
printf "%s" "$PWD/$1" > "$CURSEL"
|
printf "%s" "$PWD/$1" > "$CURSEL"
|
||||||
trap 'winch_handler; wait' WINCH
|
trap 'winch_handler' WINCH
|
||||||
trap 'rm "$PREVIEWPID" "$CURSEL" "$FIFO_UEBERZUG" "$FIFOPID" "$POSOFFSET" 2>/dev/null' INT HUP EXIT
|
trap 'rm "$PREVIEWPID" "$CURSEL" "$FIFO_UEBERZUG" "$FIFOPID" "$POSOFFSET" 2>/dev/null' INT HUP EXIT
|
||||||
wait "$!" 2>/dev/null
|
while kill -s 0 $WAITPID; do
|
||||||
|
wait $WAITPID 2>/dev/null
|
||||||
|
done
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
if [ ! -r "$NNN_FIFO" ]; then
|
if [ ! -r "$NNN_FIFO" ]; then
|
||||||
|
|
Loading…
Reference in a new issue