Tag: tmux

除非指定了–use-color,否则测试单元将使用控制台而不是tmux生成颜色

如果我创建一个新的Rails(3.2.12)应用程序。 将test-unit gem添加到我的开发,测试组,然后是scaffolded资源。 当我从Mac console.app运行测试时,我得到了颜色输出。 bundle exec rake test 当我为应用程序创建一个tmux会话(在console.app中)并运行完全相同的命令。 我没有得到颜色输出。 但是,如果我通过“–use-color”开关,那么我会在tmux中获得测试的颜色输出。 bundle exec rake test TESTOPTS=”–use-color” 我在我的tmux.config使用set -g default-terminal “screen-256color”设置256种颜色。 当我在没有TESTOPTS的情况下运行rake任务时,我知道为什么我没有在tmux中获得颜色?

如何编写启动tmux会话的shell脚本,然后运行ruby脚本

我想编写一个执行此操作的shell脚本: 首先,创建一个tmux会话 其次,在tmux会话中运行一个名为“run.rb”的ruby脚本 在伪代码中,我想做什么: tmux new -s my_session ruby run.rb # NOTE: I want this to run inside the my_session tmux session. tmux detach 我该怎么做呢? (我读的post越多,就会越混乱。)