如何让 byobu 帮助屏幕(shift-F1)在 fish 登录 shell 下工作?

如何让 byobu 帮助屏幕(shift-F1)在 fish 登录 shell 下工作?

我可以让 Shift-F1 显示使用 fish 作为登录 shell 的用户的帮助。

我瞥见了一条错误消息,但它很快就被覆盖了。

它说

fish: Variables may not be used as commands. Instead, define a function like 'function BYOBU_PAGER; sensible-pager $argv; end' or use the eval builtin instead, like 'eval $BYOBU_PAGER'. See the help section for the function command by typing 'help function'.

如果我将登录 shell 改回使用,/bin/bashchshShift-F1 将按预期显示帮助页面。

答案1

经过一番调查,似乎 Shift-F1 的键绑定定义在/usr/share/byobu/keybindings/f-keys.tmux

bind-key -n S-F1 new-window -k -n help '$BYOBU_PAGER $BYOBU_PREFIX/share/doc/byobu/help.tmux.txt'

该命令失败,因为它是在 fish shell 中执行的,而 fish shell 不允许将变量用作命令。

将绑定更改为

bind-key -n S-F1 new-window -k -n help 'sh -c "$BYOBU_PAGER $BYOBU_PREFIX/share/doc/byobu/help.tmux.txt"'

将会起作用,因为它将用于sh运行命令。

相关内容