In my Laravel application I need to run one terminal for starting a queue worker
sail artisan queue:work
Then I need to have another terminal for running various commands, like my tests.
sail artisan test --filter what_ever_test
In VSCode, I open one terminal which works perfectly fine. I can start a queue, or run tests.
The issue lies here: I need to run the queue workers, and the tests at the same time. This is normally done by opening 2 terminals, one for the queue workers and the other for the test, but in WSL2 it does not recognize anything that is going on in the first terminal.
What is unusual:
The first terminal is initiated in this path by default:
/mnt/c/Code/MyProjectName
The second terminal opens here:
/mnt/wsl/docker-desktop-bind-mounts/Ubuntu/bdee11613e19759259a804cc8393ee660dea99dfdb8bc224b3fcbcb5100da7c8$
My docker instantly creates a new container with a random hashed (?) name. So obviously that would not work.
When opening a terminal in windows using “Ubuntu” shows me a totally different file system than what is in my working directory.
Files when opening terminal through Powerhell with ubuntu command:
Default terminal when opening in VSCode, new terminal Ubuntu (works fine!
Opening another Ubuntu terminal in VSCode creates a new container, unable to switch to my working container.
I would expect that opening a new terminal would allow me to execute commands in the same environment as my current working directory. But instead it seems to create a new container in Docker. Trying to bypass VsCode by directly opening a terminal in Windows doesn’t seem to be the same Ubuntu instance, as none of my code is present. Opening this terminal in Windows as an Admin or User does not make a difference.
I don’t want a hacky solution by modifying my terminal code or whatever, I just wonder if this is a problem with docker, WSL, VSCode, is it a bug in WSL or is this intended behaviour. Most importantly how can I fix it?