Wanted to follow up with the final solution in case anyone else is looking to do something similar.
This this is what my task looks like. There are 4 bash windows, 2 local and 2 inside a docker container.
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -e STARTUP_CMD -e DOCKER_STARTUP_CMD -cur_console:pnm:/mnt -t bash -l -new_console:d:C:\file\path
set "STARTUP_CMD=docker_start_dev" & set "DOCKER_STARTUP_CMD=fms-astart" & set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -e STARTUP_CMD -e DOCKER_STARTUP_CMD -new_console:s -t bash -l -new_console:d:C:\file\path
set "STARTUP_CMD=sleep 30; queues_monitor" & set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -e STARTUP_CMD -e DOCKER_STARTUP_CMD -new_console:s1T25V -t bash -l -new_console:d:C:\file\path
set "STARTUP_CMD=docker_start_bash" & set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -e STARTUP_CMD -e DOCKER_STARTUP_CMD -new_console:s2T33V -t bash -l -new_console:d:C:\file\path
Important bits:
- setting env vars needs to be in the exact format of: set "ENV_VAR_NAME=value1; value2;...". The quotes go around the var name and the value(s).
- make sure to add "-e ENV_VAR_NAME" for each var you want passed through
- I use 'sleep 30' in one terminal to allow the other commands time to spin up before trying to execute the monitor command
- you need to add code to ~/.profile (or similar script that automatically runs on login) that will check for the env var and execute the command.
Here is the bit I added to handle it:
if [[ -n "${STARTUP_CMD}" ]]; then
alias auto=${STARTUP_CMD}
eval ${STARTUP_CMD}
unset STARTUP_CMD
fi
This will execute the command once, but also gives me a local alias for the same command. That way, if I need to kill the command in any terminal, I can easily spin it back up again. The DOCKER_STARTUP_CMD is passed through to 'docker run' with the -e option, and similar code within the container to look for a specific env var and execute the command. Hope others find this helpful.