tmux - 如何使用特殊标记来指示特定 window and/or 窗格
tmux - how to use special tokens to indicate particular window and/or pane
tmux man page 说
The following special tokens are available to indicate particular
windows. Each has a single-character alternative form.
Token Meaning
{start} ^ The lowest-numbered window
{end} $ The highest-numbered window
{last} ! The last (previously current) window
{next} + The next window by number
{previous} - The previous window by number
The following special tokens are available for the pane index:
Token Meaning
{last} ! The last (previously active) pane
{next} + The next pane by number
{previous} - The previous pane by number
....
我试过像这样使用它们
tmux send-keys -t default:!.! "^U"
tmux send-keys -t default:{last}.{last} "^U"
好像他们没有工作。使用它们的正确格式是什么?
我正在使用 tmux 3.1b
,以下会话:
tmux ls
mine: 4 windows (created Thu Jul 30 22:58:44 2020) (attached)
位于最后一个 window,有两个窗格,执行以下操作
tmux send-keys -t mine:{end}.! "echo test"
然后
tmux send-keys -t mine:{end}.! "^U"
实际上在之前活动的最后一个窗格中写入“回声测试”,然后清除该行。
编辑:
请注意,如果您想使用 !.!
语法,则必须对其进行转义:
tmux send-keys -t 'mine:!.!' "^U
as !.
似乎被 bash/zsh 解释为 otherwise
tmux man page 说
The following special tokens are available to indicate particular windows. Each has a single-character alternative form.
Token Meaning {start} ^ The lowest-numbered window {end} $ The highest-numbered window {last} ! The last (previously current) window {next} + The next window by number {previous} - The previous window by number
The following special tokens are available for the pane index:
Token Meaning {last} ! The last (previously active) pane {next} + The next pane by number {previous} - The previous pane by number ....
我试过像这样使用它们
tmux send-keys -t default:!.! "^U"
tmux send-keys -t default:{last}.{last} "^U"
好像他们没有工作。使用它们的正确格式是什么?
我正在使用 tmux 3.1b
,以下会话:
tmux ls
mine: 4 windows (created Thu Jul 30 22:58:44 2020) (attached)
位于最后一个 window,有两个窗格,执行以下操作
tmux send-keys -t mine:{end}.! "echo test"
然后
tmux send-keys -t mine:{end}.! "^U"
实际上在之前活动的最后一个窗格中写入“回声测试”,然后清除该行。
编辑:
请注意,如果您想使用 !.!
语法,则必须对其进行转义:
tmux send-keys -t 'mine:!.!' "^U
as !.
似乎被 bash/zsh 解释为 otherwise