The escaped double-quotes make
tmux run the following in a new session:
python 'DogeClickBot (2)'/main.py substituted1 ; read" && tmux split-window "python LTCClickBot/main.py substituted1 ; read
and because of quoting
read && tmux split-window python is interpreted as a single command name, as if you invoked
python … ; "read && tmux split-window python" …
This makes no sense.
Unescaped double-quotes make more sense:
tmux new-session -d "python 'DogeClickBot (2)'/main.py $1 ; read" && tmux split-window "python LTCClickBot/main.py $1 ; read"
This way in the current shell you run
tmux new-session … && tmux split-window …, which is probably what you wanted.
Note I added
-d because without it the first command would attach to the session and the next part (
&& …) would not be executed until you detached or the session was destroyed. The right thing is to attach at the very end (
Be aware this straightforward approach may introduce a race condition: what if the session dies before
tmux split-window runs? More about it in this another answer of mine. The most relevant fragment:
tmux new-window … [
tmux new-session … in your case] is a command for the tmux server,
tmux here is just a client. After the client exits successfully, you can be sure a new window [session] has been created; but you cannot really know what happens in it, on what stage, or if the window [session] has not been already destroyed.
Additionally ask yourself if you don't want to quote whatever
$1 expands to. In this fragment:
tmux new-session "python 'DogeClickBot (2)'/main.py $1 ; read"
the parameter is properly double-quoted. Then the shell spawned by the tmux server will run this:
python 'DogeClickBot (2)'/main.py substituted1 ; read
substituted1 is what
$1 expanded to. Leaving it unquoted at this stage can have similar consequences as leaving
$1 unquoted. Maybe this is what you want, maybe not. If not, then most likely you need:
tmux new-session "python 'DogeClickBot (2)'/main.py '$1' ; read"
and similar additional quoting in the second command.