【发布时间】:2022-01-04 07:39:37
【问题描述】:
是否可以将 .bashrc 或任何 .sh 文件中定义的自定义命令“加载”到 Ranger?
要通过游侠命令栏访问这些命令?
喜欢
:mycustomcommand arg1 agr2
或
:shell mycustomcommand arg1 arg2
或者
我需要用 python 重新创建它们并使用 Ranger 的 API?
【问题讨论】:
是否可以将 .bashrc 或任何 .sh 文件中定义的自定义命令“加载”到 Ranger?
要通过游侠命令栏访问这些命令?
喜欢
:mycustomcommand arg1 agr2
或
:shell mycustomcommand arg1 arg2
或者
我需要用 python 重新创建它们并使用 Ranger 的 API?
【问题讨论】:
是的,有,但是你不会看到命令的输出:
:shell *your command and arguments here*
或者直接按@
手册页还介绍了添加暂停以检查命令输出:
FLAGS
There are some additional flags that can currently be used
only in the "shell" command: (for example ":shell -w df")
p Redirect output to the pager
s Silent mode. Output will be discarded.
w Wait for an Enter-press when the process is done
顺便说一句,这个问题有点回答here。
【讨论】:
/usr/bin/mycommand 中编写自定义命令并使用cd 命令实际上在我的“终端背景”中工作。我知道它与那个线程无关,但也许你对当前会话有一些想法?