mirror of
https://github.com/jarun/nnn.git
synced 2024-11-19 09:29:15 +00:00
Improve restorepreview race conditions
This commit is contained in:
parent
a447c12866
commit
52d8aa0945
|
@ -146,15 +146,15 @@ toggle_preview() {
|
||||||
QLPATH="Bridge.exe"
|
QLPATH="Bridge.exe"
|
||||||
fi
|
fi
|
||||||
if kill "$(cat "$FIFOPID")"; then
|
if kill "$(cat "$FIFOPID")"; then
|
||||||
|
printf "0" > "$NNN_PPIPE"
|
||||||
kill "$(cat "$PREVIEWPID")"
|
kill "$(cat "$PREVIEWPID")"
|
||||||
pkill -f "tail --follow $FIFO_UEBERZUG"
|
pkill -f "tail --follow $FIFO_UEBERZUG"
|
||||||
if [ -n "$QLPATH" ] && stat "$1"; then
|
if [ -n "$QLPATH" ] && stat "$1"; then
|
||||||
f="$(wslpath -w "$1")" && "$QLPATH" "$f" &
|
f="$(wslpath -w "$1")" && "$QLPATH" "$f" &
|
||||||
fi
|
fi
|
||||||
printf "0" > "$NNN_PPIPE"
|
|
||||||
else
|
else
|
||||||
start_preview "$1" "$QLPATH"
|
|
||||||
printf "1" > "$NNN_PPIPE"
|
printf "1" > "$NNN_PPIPE"
|
||||||
|
start_preview "$1" "$QLPATH"
|
||||||
fi
|
fi
|
||||||
} >/dev/null 2>&1
|
} >/dev/null 2>&1
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ preview_fifo() {
|
||||||
if [ -n "$selection" ]; then
|
if [ -n "$selection" ]; then
|
||||||
kill "$(cat "$PREVIEWPID")"
|
kill "$(cat "$PREVIEWPID")"
|
||||||
[ -p "$FIFO_UEBERZUG" ] && ueberzug_remove
|
[ -p "$FIFO_UEBERZUG" ] && ueberzug_remove
|
||||||
[ "$selection" = "close" ] && sleep 0.1 && break
|
[ "$selection" = "close" ] && sleep 0.15 && break
|
||||||
preview_file "$selection"
|
preview_file "$selection"
|
||||||
printf "%s" "$selection" > "$CURSEL"
|
printf "%s" "$selection" > "$CURSEL"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue