From 887748cefda4255a5e73e6ca170a19cfab5ed673 Mon Sep 17 00:00:00 2001 From: devnull09 <111058423+devnull09@users.noreply.github.com> Date: Tue, 15 Nov 2022 18:07:30 +0000 Subject: [PATCH] Avoids flicker during open (#991) * Avoids flicker during open * Update lfrc.example remove setsid after we execute is with open &{{ anyway --- etc/lfrc.example | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/etc/lfrc.example b/etc/lfrc.example index 1f96c22b..15730cc1 100644 --- a/etc/lfrc.example +++ b/etc/lfrc.example @@ -35,10 +35,12 @@ map O $mimeopen --ask $f # This command is called when current file is not a directory. You may want to # use either file extensions and/or mime types here. Below uses an editor for # text files and a file opener for the rest. -cmd open ${{ +# lf -remote is used here to allow the subshell to work in the background to +# avoid redrawing lf when external applications are opened. +cmd open &{{ case $(file --mime-type -Lb $f) in - text/*) $EDITOR $fx;; - *) for f in $fx; do setsid $OPENER $f > /dev/null 2> /dev/null & done;; + text/*) lf -remote "send $id \$$EDITOR \$fx";; + *) for f in $fx; do $OPENER $f > /dev/null 2> /dev/null & done;; esac }}