我正在编写tmux版本1.4的脚本,并尝试打开新窗口,如下所示:
tmux new-session -d
tmux new-window ifconfig
tmux list-windows
0: bash [80x23] [layout b85e,80x23,0,0]
1: ifconfig [80x23] [layout b85e,80x23,0,0] (active)
tmux attach
... no output我希望ifconfig的输出会出现在窗口1中,但什么也没有显示。我的~/.tmux.conf文件中也有一行set-option -g set-remain-on-exit on。
如果我运行其他命令,有时会显示以下输出:
tmux new-window "curl www.google.com"
tmux attach
... lots of output通过尝试不同的命令,似乎显示了非常长的输出。短输出不会出现。
这种情况只在Linux中发生。如果我在用相同tmux版本构建的Mac上试用它,事情就会像预期的那样工作。
有什么想法吗?
谢谢,
发布于 2011-06-25 10:02:46
这听起来很奇怪。
ifconfig输出是否在tmux历史记录中?(C-b [和上一页)
您连接的终端是否比tmux 1.4将用于新的未连接窗口的默认80x24更小或更大?
还可以尝试完全终止tmux,然后在环境中重新启动导出EVENT_NOEPOLL=1。
如果您还没有弄清楚这一点,那么如果您将nicm发送到users . sf . net或tmux-users邮件列表,这可能是最好的选择。
发布于 2014-07-21 08:45:51
如果将shell命令传递给tmux new-window命令,则shell命令一运行完毕,它就会关闭窗格和窗口。
此外,我还遇到过这样的情况:设置全局的set- where on-exit选项不能达到预期效果。
试着运行一个不退出的命令,比如top。
tmux new-window 'top'此外,在运行短暂的命令之后,尝试启动一个新的shell。
tmux new-window 'ifconfig;bash -i'参考文献:
Prevent pane/window from closing when command completes - tmux
How do I get tmux to open up a set of panes without manually entering them?
https://stackoverflow.com/questions/5386691
复制相似问题