add the current example open command to the doc

cc #991
This commit is contained in:
Gokcehan committed 2022-11-15 21:26:30 +03:00
1 parent 887748cefd
commit 4440a15a8c
4 files changed
+41 -2

No files matched your search

+12
View File
@@ -1326,6 +1326,18 @@ You may want to use either file extensions or mime types from 'file' command:
You may want to use 'setsid' before your opener command to have persistent processes that continue to run after lf quits.
Regular shell commands (i.e. '$') drop to terminal which results in a flicker for commands that finishes immediately (e.g. 'xdg-open' in the above example).
If you want to use asynchronous shell commands (i.e. '&') but also want to use the terminal when necessary (e.g. 'vi' in the above exxample), you can use a remote command:
cmd open &{{
case $(file --mime-type -Lb $f) in
text/*) lf -remote "send $id \$vi \$fx";;
*) for f in $fx; do xdg-open $f > /dev/null 2> /dev/null & done;;
esac
}}
Note, asynchronous shell commands run in their own process group by default so they do not require the manual use of 'setsid'.
Following command is provided by default:
cmd open &$OPENER $f
+16
View File
@@ -1429,6 +1429,22 @@ You may want to use either file extensions or mime types from 'file' command:
You may want to use 'setsid' before your opener command to have persistent
processes that continue to run after lf quits.
Regular shell commands (i.e. '$') drop to terminal which results in a flicker
for commands that finishes immediately (e.g. 'xdg-open' in the above example).
If you want to use asynchronous shell commands (i.e. '&') but also want to use
the terminal when necessary (e.g. 'vi' in the above exxample), you can use a
remote command:
cmd open &{{
case $(file --mime-type -Lb $f) in
text/*) lf -remote "send $id \$vi \$fx";;
*) for f in $fx; do xdg-open $f > /dev/null 2> /dev/null & done;;
esac
}}
Note, asynchronous shell commands run in their own process group by default so
they do not require the manual use of 'setsid'.
Following command is provided by default:
cmd open &$OPENER $f
-2
View File
@@ -35,8 +35,6 @@ 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.
# 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/*) lf -remote "send $id \$$EDITOR \$fx";;
+13
View File
@@ -1532,6 +1532,19 @@ You may want to use either file extensions or mime types from 'file' command:
.PP
You may want to use 'setsid' before your opener command to have persistent processes that continue to run after lf quits.
.PP
Regular shell commands (i.e. '$') drop to terminal which results in a flicker for commands that finishes immediately (e.g. 'xdg-open' in the above example). If you want to use asynchronous shell commands (i.e. '&') but also want to use the terminal when necessary (e.g. 'vi' in the above exxample), you can use a remote command:
.PP
.EX
cmd open &{{
case $(file --mime-type -Lb $f) in
text/*) lf -remote "send $id \e$vi \e$fx";;
*) for f in $fx; do xdg-open $f > /dev/null 2> /dev/null & done;;
esac
}}
.EE
.PP
Note, asynchronous shell commands run in their own process group by default so they do not require the manual use of 'setsid'.
.PP
Following command is provided by default:
.PP
.EX