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 }}