Search code examples
visual-studiovisual-studio-debugging

How to group debug console windows in Visual Studio?


I'm debugging 3 web api's and one api gateway. When I'm running all 4 of them at once I get 4 console windows like this:

enter image description here

Is there any way to group them? Or to use tabs?


Solution

  • In Windows 11 there is "Windows Terminal", which is the evolution of Command Prompt. It's possible to install it also in Windows 10.

    You have to set Windows Terminal as the default terminal, and change the "New instance behaviour" setting to "Attach to the most recently used window".
    Then, every time you run a console project from Visual Studio, it will open as a new tab in Windows Terminal.

    Note that by changing this setting, every new terminal will open in a new tab.

    Otherwise, if you start debug from console/script, you can run each project in a new tab of a specific window (YOUR_WINDOW_NAME) with:

    wt -w <YOUR_WINDOW_NAME> new-tab dotnet.exe run --project <PROJECT_PATH>
    

    It's also possible to split the Terminal in multiple panels (split-pane), see documentation.