I am on macOS and using zsh.
I have created a folder ~/bin/ which I've added to my path. I created a shell script ~/bin/testscript containing the following code
#!/bin/sh
tmux new-session -s testsession
tmux split-window -v
and used chmod -R 700 ~/bin to set the permissions -rwx------.
When executing the lines from the shell script successively by typing them in the shell I get a new tmux session with vertically split windows. This is the expected behavior. However, when I type testscript into the shell I only get a new tmux session, but without vertically split windows.
What do I need to do to change in the script to get a session with split windows? I've copied the above code from this thread, but it doesn't work for me.
 
     
    