rifle.conf
文件中没有列出的GUI应用程序(即使用open_with
命令)打开一个文件时,ranger终端窗口会被“挂起”,直到我关闭GUI应用程序。因此,我希望有一种方法可以用特定的应用程序打开文件,但仍然能够在ranger终端中浏览文件。
当您使用
rifle.conf
文件中列出的应用程序之一打开相同的文件时,这是默认行为。有没有办法实现这个目标?
open_with
和f
或t
标志:
open_with [application] [flags] [mode]
Open the selected files with the given application, unless it is omitted, in which case the default application is used. flags change the way the application is executed and are described in their own section in this man page. The mode is a number that specifies which application to use. The list of applications is generated by the external file opener "rifle" and can be displayed when pressing "r" in ranger.
Note that if you specify an application, the mode is ignored.
Flags give you a way to modify the behavior of the spawned process. They are used in the commands :open_with (key "r") and :shell (key "!").
f Fork the process. (Run in background) c Run the current file only, instead of the selection r Run application with root privilege (requires sudo) t Run application in a new terminal window
It seems to be, based on an sample
rifle.conf
file I found, that you'd need thef
flag to ask Ranger to Fork the program, make it run in the background:ext png, flag f = viewnior "$@"
ext png, flag f = viewnior "$@" &
f
标志也是如此。请参考被接受的答案。 - Kusalananda