Visual Studio 2022 uses cmd instead of windows terminal #17417

Closed
opened 2026-01-31 05:41:53 +00:00 by claunia · 12 comments
Owner

Originally created by @suntsu42 on GitHub (May 6, 2022).

Windows Terminal version

1.13.10984.0

Windows build number

10.0.22000.0

Other Software

No response

Steps to reproduce

I've configured windows terminal to be the default terminal:
image

I've created a simple .net 6 console application in Visual Studio Professional 2022
image

When i debug this console application, its started in a cmd shell rather than in the windows terminal
image

When i run cmd via "Windows-R", it does actually start the terminal (as expected). This means the windows terminal is set as default terminal for windows.

Is there a specific settings in visual studio in order to force the use of the windows terminal?

Expected Behavior

Visual studio starts the windows terminal when debugging a console application

Actual Behavior

Visual studio starts the cmd terminal

Originally created by @suntsu42 on GitHub (May 6, 2022). ### Windows Terminal version 1.13.10984.0 ### Windows build number 10.0.22000.0 ### Other Software _No response_ ### Steps to reproduce I've configured windows terminal to be the default terminal: ![image](https://user-images.githubusercontent.com/1768336/167101141-1090f46b-6c60-448a-b4f9-34d93df2e978.png) I've created a simple .net 6 console application in Visual Studio Professional 2022 ![image](https://user-images.githubusercontent.com/1768336/167101187-e05ed0fb-a8c2-49e8-a140-3ff5779446cb.png) When i debug this console application, its started in a cmd shell rather than in the windows terminal ![image](https://user-images.githubusercontent.com/1768336/167101313-5982a9f4-9968-4ae0-8152-d5e8f98abf83.png) When i run **cmd** via "Windows-R", it does actually start the terminal (as expected). This means the windows terminal is set as default terminal for windows. Is there a specific settings in visual studio in order to force the use of the windows terminal? ### Expected Behavior Visual studio starts the windows terminal when debugging a console application ### Actual Behavior Visual studio starts the cmd terminal
Author
Owner

@zadjii-msft commented on GitHub (May 6, 2022):

That's weird, I can't repro this on VS Version 17.1.0 Preview 1.1. Which version of VS are you on/? IIRC they had a fix on their side a little while back for something like this...

@zadjii-msft commented on GitHub (May 6, 2022): That's weird, I can't repro this on VS Version 17.1.0 Preview 1.1. Which version of VS are you on/? IIRC they had a fix on their side a little while back for something like this...
Author
Owner

@suntsu42 commented on GitHub (May 6, 2022):

Version 17.1.6

Output from visual studio info dialog:

Version 17.1.6
VisualStudio.17.Release/17.1.6+32421.90
Microsoft .NET Framework
Version 4.8.04161

Installed Version: Professional

.NET Core Debugging with WSL   1.0
.NET Core Debugging with WSL

ASP.NET and Web Tools 2019   17.1.363.30963
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019   17.1.363.30963
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   17.1.363.30963
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   17.1.363.30963
Azure Functions and Web Jobs Tools

C# Tools   4.1.0-5.22165.10+e555772db77ca828b02b4bd547c318387f11d01f
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Markdown Editor v2   2.0.102
A full featured Markdown editor with live preview and syntax highlighting. Supports GitHub flavored Markdown.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager   2.1.161+abc97ecc7d.RR
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio Tools for Containers   1.2
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

NuGet Package Manager   6.1.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core)   17.0.0.2206201+62a2c1d6162f828801565a7ca26d9d48b810a05b
Provides languages services for ASP.NET Core Razor.

ResX Resource Manager   ResXManager
Manage localization of all ResX-based resources in one place. Shows all resources of a solution and lets you edit the strings and their localizations in a well-arranged data grid.

SonarLint for Visual Studio   6.4.0.47562
SonarLint is an extension to your favorite IDE that provides on-the-fly feedback to developers on new bugs and quality issues injected into their code.

SQL Server Data Tools   17.0.62203.25080
Microsoft SQL Server Data Tools

TypeScript Tools   17.0.1229.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   4.1.0-5.22165.10+e555772db77ca828b02b4bd547c318387f11d01f
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools   17.1.0-beta.21610.4+07b5673e4f2fa7630e78abe37f16b372353a7242
Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions   1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio IntelliCode   2.2
AI-assisted development for Visual Studio.

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers```
@suntsu42 commented on GitHub (May 6, 2022): Version 17.1.6 Output from visual studio info dialog: ```Microsoft Visual Studio Professional 2022 Version 17.1.6 VisualStudio.17.Release/17.1.6+32421.90 Microsoft .NET Framework Version 4.8.04161 Installed Version: Professional .NET Core Debugging with WSL 1.0 .NET Core Debugging with WSL ASP.NET and Web Tools 2019 17.1.363.30963 ASP.NET and Web Tools 2019 ASP.NET Web Frameworks and Tools 2019 17.1.363.30963 For additional information, visit https://www.asp.net/ Azure App Service Tools v3.0.0 17.1.363.30963 Azure App Service Tools v3.0.0 Azure Functions and Web Jobs Tools 17.1.363.30963 Azure Functions and Web Jobs Tools C# Tools 4.1.0-5.22165.10+e555772db77ca828b02b4bd547c318387f11d01f C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools. Markdown Editor v2 2.0.102 A full featured Markdown editor with live preview and syntax highlighting. Supports GitHub flavored Markdown. Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines Microsoft Library Manager 2.1.161+abc97ecc7d.RR Install client-side libraries easily to any web project Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers Microsoft Visual Studio Tools for Containers 1.2 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container. NuGet Package Manager 6.1.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/ Razor (ASP.NET Core) 17.0.0.2206201+62a2c1d6162f828801565a7ca26d9d48b810a05b Provides languages services for ASP.NET Core Razor. ResX Resource Manager ResXManager Manage localization of all ResX-based resources in one place. Shows all resources of a solution and lets you edit the strings and their localizations in a well-arranged data grid. SonarLint for Visual Studio 6.4.0.47562 SonarLint is an extension to your favorite IDE that provides on-the-fly feedback to developers on new bugs and quality issues injected into their code. SQL Server Data Tools 17.0.62203.25080 Microsoft SQL Server Data Tools TypeScript Tools 17.0.1229.2001 TypeScript Tools for Microsoft Visual Studio Visual Basic Tools 4.1.0-5.22165.10+e555772db77ca828b02b4bd547c318387f11d01f Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Visual F# Tools 17.1.0-beta.21610.4+07b5673e4f2fa7630e78abe37f16b372353a7242 Microsoft Visual F# Tools Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio Visual Studio Container Tools Extensions 1.0 View, manage, and diagnose containers within Visual Studio. Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio. Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers```
Author
Owner

@fortizfe commented on GitHub (May 13, 2022):

Hello!

Same problem here. Any suggested solutions ?

@fortizfe commented on GitHub (May 13, 2022): Hello! Same problem here. Any suggested solutions ?
Author
Owner

@rubo commented on GitHub (Jul 8, 2022):

Same here but only with <Project Sdk="Microsoft.NET.Sdk.Web">. For <Project Sdk="Microsoft.NET.Sdk">, it works just fine.

@rubo commented on GitHub (Jul 8, 2022): Same here but only with `<Project Sdk="Microsoft.NET.Sdk.Web">`. For `<Project Sdk="Microsoft.NET.Sdk">`, it works just fine.
Author
Owner

@zadjii-msft commented on GitHub (Aug 1, 2022):

Hmm, I'm up to 17.3.0 Preview 2.0 now, and I'm still not seeing this, even with a <Project Sdk="Microsoft.NET.Sdk.Web"> console app.

image

The default terminal detection has been pretty stable for a few OS release now. If there's some subset of VS projects that this does still repro for, best to report this directly at Developer Community.

(spoiler alert: looks like they've got a lot of issues with their handoff)

@zadjii-msft commented on GitHub (Aug 1, 2022): Hmm, I'm up to 17.3.0 Preview 2.0 now, and I'm still not seeing this, even with a `<Project Sdk="Microsoft.NET.Sdk.Web">` console app. ![image](https://user-images.githubusercontent.com/18356694/182210753-4470fa6d-4aa9-435a-8341-12830a07fa7b.png) The default terminal detection has been pretty stable for a few OS release now. If there's some subset of VS projects that this does still repro for, best to report this directly at [Developer Community](https://developercommunity.visualstudio.com/search?entry=problem&space=8). (spoiler alert: [looks like they've got a lot of issues with their handoff](https://developercommunity.visualstudio.com/search?entry=problem&space=8&q=default+terminal))
Author
Owner

@rubo commented on GitHub (Aug 11, 2022):

Fixed in Visual Studio v17.3.0

@rubo commented on GitHub (Aug 11, 2022): Fixed in Visual Studio v17.3.0
Author
Owner

@suntsu42 commented on GitHub (Aug 12, 2022):

I'm now using Visual Studio v17.3.0 and it still doesn't open the windows terminal.
image
image

@suntsu42 commented on GitHub (Aug 12, 2022): I'm now using Visual Studio v17.3.0 and it still doesn't open the windows terminal. ![image](https://user-images.githubusercontent.com/1768336/184290400-5d592f59-f608-4d2d-a7ab-710896e9ba2d.png) ![image](https://user-images.githubusercontent.com/1768336/184290439-d1146612-e5c0-4259-8229-ca01268fe23d.png)
Author
Owner

@MasterIPI commented on GitHub (Mar 14, 2023):

I'm now using Visual Studio v17.3.0 and it still doesn't open the windows terminal. image image

Same issue even in the v17.5.1 of VS 2022
Just found a work around for me, check your startup configuration of the visual studio. If it runs as administrator - then it won't launch the terminal, remove checkbox in startup options from that option and it will launch console apps in the terminal.

@MasterIPI commented on GitHub (Mar 14, 2023): > I'm now using Visual Studio v17.3.0 and it still doesn't open the windows terminal. ![image](https://user-images.githubusercontent.com/1768336/184290400-5d592f59-f608-4d2d-a7ab-710896e9ba2d.png) ![image](https://user-images.githubusercontent.com/1768336/184290439-d1146612-e5c0-4259-8229-ca01268fe23d.png) Same issue even in the v17.5.1 of VS 2022 Just found a work around for me, check your startup configuration of the visual studio. If it runs as administrator - then it won't launch the terminal, remove checkbox in startup options from that option and it will launch console apps in the terminal.
Author
Owner

@mayureshs commented on GitHub (Mar 12, 2024):

Is there a way to launch VS2022 as administrator and still have the Terminal as the default option instead of the ConsoleApp?

@mayureshs commented on GitHub (Mar 12, 2024): Is there a way to launch VS2022 as administrator and still have the Terminal as the default option instead of the ConsoleApp?
Author
Owner

@MaverickMartyn commented on GitHub (Apr 15, 2024):

I too would like to know how to get that to work, since my workflow requires me to run VS as administrator so I can debug the IIS (w3wp.exe) process.
VS Version: 17.9.6.
Windows Terminal Version: 1.19.10821.0

@MaverickMartyn commented on GitHub (Apr 15, 2024): I too would like to know how to get that to work, since my workflow requires me to run VS as administrator so I can debug the IIS (w3wp.exe) process. VS Version: 17.9.6. Windows Terminal Version: 1.19.10821.0
Author
Owner

@zadjii-msft commented on GitHub (Apr 15, 2024):

We're more or less tracking that issue over in #10276. It's a platform limitation currently that elevated applications cannot use the default terminal handoff.

@zadjii-msft commented on GitHub (Apr 15, 2024): We're more or less tracking that issue over in #10276. It's a platform limitation currently that elevated applications cannot use the default terminal handoff.
Author
Owner

@Echostorm44 commented on GitHub (May 28, 2025):

Still not working for Admin (which is how many of us have to run it)

Image

@Echostorm44 commented on GitHub (May 28, 2025): Still not working for Admin (which is how many of us have to run it) ![Image](https://github.com/user-attachments/assets/127f6cdc-4287-4dd8-b364-e8a8cf3e899a)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17417