Windows Terminal script opens one unnecessary tab more

Gizm0 0 Reputation points
2024-11-26T14:45:53.2066667+00:00

I have this simple .bat script for Windows terminal:

wt c:\path\bin\Debug\OurSimulator.exe --port 6101;sp -V c:\path\bin\Debug\OurSimulator.exe --port 6102;sp -V c:\path\bin\Debug\OurSimulator.exe --port 6103;sp -V c:\path\bin\Debug\OurSimulator.exe --port 6104;

However, every time I run it, apart from opening one tab divided into 4 columns as I want to, it also opens one tab more with default app (in my case cmd line). I always have to close it/switch to the first one to be able to see the output, which is one unnecessary step I wanna get rid of.

So first I have to close this, to be able to see only this.

Can somebody point me to what should I change to stop this from happening?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,866 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 55,501 Reputation points
    2024-11-26T15:21:06.2233333+00:00

    Windows just runs the associated program for the file extension. If I understand correctly you're starting a batch script (which is likely using Terminal?) to then start Windows Terminal (the wt) command. You really shouldn't need to do both.

    As discussed in the command line options here you should probably set the value to useAnyExisting if you want it to reuse an existing tab. By default it will always open a new window and since you're starting a batch file that makes sense.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.