follow symlinks when detecting filetype in lf (#1052)

fix bug in lf where symlinked files don't open in the expected program
This commit is contained in:
Future is FOSS 2021-12-04 13:47:35 +00:00 committed by GitHub
parent 499aeaed3a
commit ed9a67ed6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@ $lf -remote "send $id set previewer ${XDG_CONFIG_HOME:-$HOME/.config}/lf/scope"
# cmds/functions
cmd open ${{
case $(file --mime-type $f -b) in
case $(file --mime-type "$(readlink -f $f)" -b) in
image/vnd.djvu|application/pdf|application/octet-stream|application/postscript) setsid -f zathura $fx >/dev/null 2>&1 ;;
text/*) $EDITOR $fx;;
image/x-xcf) setsid -f gimp $f >/dev/null 2>&1 ;;