Add this to Windows Terminal settings (Settings -> Open JSON file) after launchMode
for example:
"startupActions": "new-tab -p Ubuntu wsl -- source ~/.bash_profile \\; cd ~/www/rails-project \\; bin/rails s \\; $SHELL; new-tab -p Ubuntu wsl -- source ~/.bash_profile \\; cd ~/www/rails-project \\; bin/webpack-dev-server \\; $SHELL; new-tab -p Ubuntu wsl -- source ~/.bash_profile \\; cd ~/www/rails-project \\; $SHELL"
Explanation:
Start rails server. Tab will not be closed if server stopped by user, because of $SHELL. Using source ~/.bash_profile
because rvm not loaded without it