Ranger - 不暂停地打开

当我使用一个在rifle.conf文件中没有列出的GUI应用程序(即使用open_with命令)打开一个文件时,ranger终端窗口会被“挂起”,直到我关闭GUI应用程序。
因此,我希望有一种方法可以用特定的应用程序打开文件,但仍然能够在ranger终端中浏览文件。
当您使用rifle.conf文件中列出的应用程序之一打开相同的文件时,这是默认行为。
有没有办法实现这个目标?
3个回答

尝试使用open_withft标志:
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

你让我开心不已 :D - tigerjack
10如何将此设置为ranger的默认行为?也就是说,当我按下“RIGHT”键尝试打开一个文件时,它应该使用“f”标志来打开。 - Inspired_Blue

你可以在这里看到:Ranger,打开文件冻结终端 那里的被接受的答案是:

It seems to be, based on an sample rifle.conf file I found, that you'd need the f flag to ask Ranger to Fork the program, make it run in the background:

ext png, flag f = viewnior "$@"

欢迎来到本网站,并感谢您的贡献。请注意,如果您在问题中发现可能的重复,最好的方式是向版主标记一篇帖子,而不是在问题之间“复制”答案。 - AdminBee

我通过在末尾添加“&”解决了这个问题。
ext png, flag f = viewnior "$@" &

"&" 强制程序在后台运行。

所以f标志也是如此。请参考被接受的答案。 - Kusalananda