summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorlvgx <l@vgx.fr>2020-06-06 17:17:41 +0200
committerGitHub <noreply@github.com>2020-06-06 20:47:41 +0530
commit58411446b71843b8307f8b20f9507b6327429334 (patch)
tree3a95fac637960b1e4f619987bd0c14eec6d08ffc /plugins
parent65cf067dc465605563481ecb0865a68924653434 (diff)
preview-kitty: fix crash on first file on dash (#636)
In the dash shell, when `exec < fifo` is interrupted by SIGCHLD, it exits. So we replace it with `cat fifo |`. Issue discussed in #614
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/preview-kitty4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/preview-kitty b/plugins/preview-kitty
index 738411c4..af51cee0 100755
--- a/plugins/preview-kitty
+++ b/plugins/preview-kitty
@@ -63,7 +63,9 @@ if [ "$PREVIEW_MODE" ] ; then
preview_file "$1"
- exec < "$NNN_FIFO"
+ # use cat instead of 'exec <' to avoid issues with dash shell
+ # shellcheck disable=SC2002
+ cat "$NNN_FIFO" |\
while read -r selection ; do
preview_file "$selection"
done