I’m trying to run a Ruby program that runs tmux to create a new session. I’m testing this with Cucumber. The Ruby program by itself works ok and starts the tmux session but when the code is run from the Cucumber scenario I get an error on the console amongst the Cucumber output – ‘not a terminal’.
I understand this is due to tmux believing it is not being run in a terminal due to the return value of isatty() which tmux calls on startup. Why does this happen when running through Cucumber and is there anyway around it as I would really like to be able to test my program with these scenarios.
It appears I can get around the problem if I start the tmux sessions ‘detached’ with the -d option. I would prefer to be left inside the tmux session but this is the next best solution and it means I can continue my development with working tests!
I’m still not sure why I get the ‘not a terminal’ message when running ‘tmux new-session’ through Cucumber but not when I use the ruby script on the command line directly…