3

我正在编写 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 OS X 上尝试它,事情会按预期工作。

有任何想法吗?

谢谢,

4

2 回答 2

1

如果您将 shell-command 传递给 tmux new-window 命令,它会在 shell-command 运行完成后立即关闭窗格和窗口。

此外,我遇到过设置全局 set-remain-on-exit 选项没有按预期工作的情况。

尝试运行不退出的命令,例如top.

tmux new-window 'top'

此外,请尝试在运行短暂的命令后启动新的 shell。

tmux new-window 'ifconfig;bash -i'

参考:

命令完成时防止窗格/窗口关闭 - tmux

如何让 tmux 打开一组窗格而不手动输入它们?

于 2014-07-21T00:45:50.610 回答
1

这听起来很奇怪。

ifconfig 输出是否在 tmux 历史记录中?(Cb [ 和向上翻页)

您连接到的终端是否比 tmux 1.4 将用于新的未连接窗口的默认 80x24 小得多或大得多?

还可以尝试完全杀死 tmux 并在环境中使用 export EVENT_NOEPOLL=1 重新启动。

如果您还没有弄清楚,并且如果您将 nicm 发送到 users dot sf dot net 或 tmux-users 邮件列表,这可能是最好的。

于 2011-06-25T02:02:45.907 回答