Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does this Windows Terminal batch file open an extra tab?

I'm attempting to run all four sites at the same time within a single tab of Windows Terminal using split panes only. I have the following abp tiered MVC/efcore startup batch file:

wt -M -d "./src/MyProject.Web" cmd /k "title Website & dotnet watch run"; ^
split-pane -V -d "./src/MyProject.IdentityServer" cmd /k "title IdentityServer & dotnet watch run"; ^
move-focus left; ^
split-pane -H -d "./src/MyProject.HttpApi.Host" cmd /k "title ApiHost & dotnet watch run"; ^
move-focus right; ^
split-pane -H -d "./src/MyProject.Web.Public" cmd /k "title Public & dotnet watch run";

When it starts, there are two tabs. One tab correctly has all four sites started and the other is just the startup directory and/or profile. How can I modify the batch file to eliminate the extra useless tab?

This is what I want (only):four running sites in a single wt tab

like image 624
djbyter Avatar asked Feb 02 '26 09:02

djbyter


1 Answers

Ah - the answer was the last semi-colon was causing a new tab. I was reading the documentation and noticed that the (;) was being used to open tabs which makes sense in the middle of the command but the one at the end was extraneous.

This is the correct batch for this task:

wt -M -d "./src/MyProject.Web" cmd /k "title Website & dotnet watch run"; ^
split-pane -V -d "./src/MyProject.IdentityServer" cmd /k "title IdentityServer & dotnet watch run"; ^
move-focus left; ^
split-pane -H -d "./src/MyProject.HttpApi.Host" cmd /k "title ApiHost & dotnet watch run"; ^
move-focus right; ^
split-pane -H -d "./src/MyProject.Web.Public" cmd /k "title Public & dotnet watch run"
like image 194
djbyter Avatar answered Feb 04 '26 00:02

djbyter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!