Merge pull request #961 from luukvbaal/preview-tui

preview-tui: close previewer
This commit is contained in:
Piña Colada 2021-04-23 03:51:16 +05:30 committed by GitHub
commit 59dfffd004
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -273,6 +273,15 @@ if [ "$PREVIEW_MODE" ]; then
exit 0
fi
if pgrep -f "cat $NNN_FIFO" >/dev/null; then
if exists QuickLook.exe && stat "$1" >/dev/null 2>&1; then
f="$(wslpath -w "$1" 2>&1)" && QuickLook.exe "$f" &
elif exists Bridge.exe && stat "$1" >/dev/null 2>&1; then
f="$(wslpath -w "$1" 2>&1)" && Bridge.exe "$f" &
fi
pkill -f "cat $NNN_FIO"
exit 0
fi
if [ "$TERMINAL" = "tmux" ]; then
# tmux splits are inverted
if [ "$SPLIT" = "v" ]; then SPLIT="h"; else SPLIT="v"; fi

View File

@ -374,6 +374,15 @@ if [ "$PREVIEW_MODE" ]; then
exit 0
fi
if pgrep -f "cat $NNN_FIFO" >/dev/null; then
if exists QuickLook.exe && stat "$1" >/dev/null 2>&1; then
f="$(wslpath -w "$1" 2>&1)" && QuickLook.exe "$f" &
elif exists Bridge.exe && stat "$1" >/dev/null 2>&1; then
f="$(wslpath -w "$1" 2>&1)" && Bridge.exe "$f" &
fi
pkill -f "cat $NNN_FIO"
exit 0
fi
if [ "$TERMINAL" = "tmux" ]; then
# tmux splits are inverted
if [ "$SPLIT" = "v" ]; then SPLIT="h"; else SPLIT="v"; fi