Skip to content

Commit

Permalink
Merge pull request #1747 from luukvbaal/master
Browse files Browse the repository at this point in the history
Preview-tui avoid early exit after SIGWINCH
  • Loading branch information
jarun authored Oct 18, 2023
2 parents 7f63bef + f8f6d6a commit 1051d72
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugins/preview-tui
Original file line number Diff line number Diff line change
Expand Up @@ -475,12 +475,14 @@ if [ "$PREVIEW_MODE" -eq 1 ] 2>/dev/null; then
fi

preview_file "$PWD/$1"
preview_fifo &
preview_fifo & WAITPID=$!
printf "%s" "$!" > "$FIFOPID"
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
wait "$!" 2>/dev/null
while kill -s 0 $WAITPID; do
wait $WAITPID 2>/dev/null
done
exit 0
else
if [ ! -r "$NNN_FIFO" ]; then
Expand Down

0 comments on commit 1051d72

Please sign in to comment.