I'm trying to write a script to setup tmux for a dev environment, in WSL Windows 10, but it keeps throwing this error. What is odd is that if I copy this script to a subdirectory or somewhere else, sometimes it works (depending on where). The behavior is very strange, as if I copy the code to another file and run in another directory, sometimes it gives this error, sometimes it runs but kind of breaks, frustrating!
Here is the tmux bash script:
tmux.sh
#!/bin/sh
tmux new-session -d
tmux attach-session -d
tmux split-window -v
tmux split-window -h
When I run it it gives the errors:
rw3iss@rw3iss:/mnt/c/Users/Ryan/Sites/testsite/src$ ./tmux.sh
tmux: unknown option --
no server running on /tmp/tmux-1000/default
tmux: unknown option --
no server running on /tmp/tmux-1000/default
: not found: ./dev.sh:
tmux: unknown option --
no server running on /tmp/tmux-1000/default
no server running on /tmp/tmux-1000/default
Any ideas, please?