如何向 tmux 中的所有窗格发送命令? [英] How to send a command to all panes in tmux?

查看:64
本文介绍了如何向 tmux 中的所有窗格发送命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢在具有巨大回滚的窗格上调用 :clear-history.但是,我想编写一种方法来将此命令发送到各个窗口中的所有窗格.

I like to call :clear-history on panes with a huge scrollback. However, I want to script a way to send this command to all the panes in the various windows.

我知道如何向所有窗口发送命令,这是由 提供的问题,但我如何向哪个窗口的所有窗格发送命令?

I know how to send a command to all the windows, courtesy of this question, but how do I send a command to all the panes of which window as well?

send-keyssynchronize-panes,但我不确定如何将它们结合在一起.但也许有一种更简单的方法可以做到这一点.

send-keys and synchronize-panes from the tmux manpage come to mind, but I'm not sure how to marry them together. But maybe there is a simpler way to do this.

稍微思考一下,tmux list-panes -a 似乎列出了当前会话中的所有窗格.开始时非常有用.我从这里去哪里?

Thinking about this a little bit, tmux list-panes -a seems to list all the panes in the current session. Pretty useful to start off with. Where do I go from here?

推荐答案

您是否尝试过在 tmux 窗口中跟随多个窗格

Have you tried following in tmux window with multiple panes

Ctrl-B :

setw synchronize-panes on

clear history

这篇关于如何向 tmux 中的所有窗格发送命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆