How does "Default Terminal" work? #20391

Closed
opened 2026-01-31 07:12:23 +00:00 by claunia · 8 comments
Owner

Originally created by @tang-nn on GitHub (Aug 20, 2023).

Why do I directly double-click the cmd.exe file in the System32 directory, it will also open in Windows Terminal? How is it achieved? Ask for answers

Originally created by @tang-nn on GitHub (Aug 20, 2023). Why do I directly double-click the cmd.exe file in the System32 directory, it will also open in Windows Terminal? How is it achieved? Ask for answers
Author
Owner

@237dmitry commented on GitHub (Aug 20, 2023):

What is your default terminal application? Check settings of Windows Terminal or conhost.exe. In my settings "Let Windows decide"

Win+R > conhost

Screenshot 2023-08-20 183602

@237dmitry commented on GitHub (Aug 20, 2023): What is your default terminal application? Check settings of Windows Terminal or conhost.exe. In my settings "Let Windows decide" ``` Win+R > conhost ``` ![Screenshot 2023-08-20 183602](https://github.com/microsoft/terminal/assets/78153320/e3068170-43db-4c71-b8d4-a87c3b18b459)
Author
Owner

@tang-nn commented on GitHub (Aug 21, 2023):

I want to know how it works

@tang-nn commented on GitHub (Aug 21, 2023): I want to know how it works
Author
Owner

@237dmitry commented on GitHub (Aug 21, 2023):

I want to know how it works

Change the default terminal applications and check values in the HKCU\Console\%%Startup registry key.

Can be read here

@237dmitry commented on GitHub (Aug 21, 2023): > I want to know how it works Change the default terminal applications and check values in the `HKCU\Console\%%Startup` registry key. [Can be read here](https://support.microsoft.com/en-us/windows/command-prompt-and-windows-powershell-for-windows-11-6453ce98-da91-476f-8651-5c14d5777c20)
Author
Owner

@tang-nn commented on GitHub (Aug 21, 2023):

I deleted the registry key HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe,
Also opens in Terminal

@tang-nn commented on GitHub (Aug 21, 2023): I deleted the registry key `HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe`, Also opens in Terminal
Author
Owner

@tang-nn commented on GitHub (Aug 21, 2023):

It should be a bug when my cmd is opened in Terminal

@tang-nn commented on GitHub (Aug 21, 2023): It should be a bug when my cmd is opened in Terminal
Author
Owner

@237dmitry commented on GitHub (Aug 21, 2023):

I deleted the registry key HKEY_CURRENT_USER\Console%SystemRoot%_system32_cmd.exe

You deleted console host settings for Windows\System32\cmd.exe (color, size, font etc) This out of subject.

It should be a bug when my cmd is opened in Terminal

In my environment all works as expected (win 11 22H2).

  • set default terminal application
  • relogin (maybe no need to do)
@237dmitry commented on GitHub (Aug 21, 2023): > I deleted the registry key HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe You deleted console host settings for Windows\System32\cmd.exe (color, size, font etc) This out of subject. > It should be a bug when my cmd is opened in Terminal In my environment all works as expected (win 11 22H2). - set default terminal application - relogin (maybe no need to do)
Author
Owner

@tang-nn commented on GitHub (Aug 21, 2023):

image
image
image

@tang-nn commented on GitHub (Aug 21, 2023): ![image](https://github.com/microsoft/terminal/assets/98725149/e57d754e-2f1d-4efd-86b8-750e4e67a6b6) ![image](https://github.com/microsoft/terminal/assets/98725149/c5508f4f-09e6-4e43-85ad-91f6a3eef677) ![image](https://github.com/microsoft/terminal/assets/98725149/36ea4932-8e13-4e80-87c1-4c0a47ac2811)
Author
Owner

@zadjii-msft commented on GitHub (Aug 21, 2023):

What you're seeing is the "Default Terminal" feature in Windows 11, which lets you change which application is used as the default terminal emulator for command-line applications. That was previously always "conhost.exe", but now the Windows Terminal can be used as the default emulator too.

How it works is... complicated... and I believe we're tracking writing those docs in #9462. It was originally spec'd here: #7414

The other comment you have in this thread, about the leading spaces, looks like it's the same thing we're discussing with you in #15836, so I'm gonna collapse that as off-topic.

@zadjii-msft commented on GitHub (Aug 21, 2023): What you're seeing is the "Default Terminal" feature in Windows 11, which lets you change which application is used as the default terminal emulator for command-line applications. That was previously always "conhost.exe", but now the Windows Terminal can be used as the default emulator too. _How_ it works is... complicated... and I believe we're tracking writing those docs in #9462. It was originally spec'd here: #7414 The other comment you have in this thread, about the leading spaces, looks like it's the same thing we're discussing with you in #15836, so I'm gonna collapse that as off-topic.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20391