]> Sergey Matveev's repositories - nnn.git/commitdiff
Proper fix for preview-tui zombie-pane
authorLuuk van Baal <luukvbaal@gmail.com>
Tue, 9 Nov 2021 13:33:52 +0000 (14:33 +0100)
committerLuuk van Baal <luukvbaal@gmail.com>
Tue, 9 Nov 2021 13:33:52 +0000 (14:33 +0100)
plugins/preview-tui

index 0f5d60edc0a4eccae2e790ba7e7bc225a178592b..e65bc43ac3a6a0cbfbb30dc1831f37c961938125 100755 (executable)
@@ -401,13 +401,6 @@ ueberzug_remove() {
 }
 
 winch_handler() {
-    # workaround for preview-tui tmux child causing zombie pane
-    if [ "$NNN_PARENT" -eq "$NNN_PARENT" ] 2>/dev/null; then
-        kill -0 "$NNN_PARENT" || return
-    else
-        pidof nnn || return
-    fi
-
     clear
     kill "$(cat "$PREVIEWPID")"
     if [ -p "$FIFO_UEBERZUG" ]; then
@@ -427,6 +420,7 @@ preview_fifo() {
             printf "%s" "$selection" > "$CURSEL"
         fi
     done < "$NNN_FIFO"
+    sleep 0.1 # make sure potential preview by winch_handler is killed
     pkill -P "$$"
 } 2>/dev/null