-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DefApp] Document how it works #9462
Comments
Could you hint us about what Windows version will support this feature? |
Windows 11? 🤣 I'm kidding, it'll probably be something above build 21336, but that's about as sure as we can be right now. Build numbers can change a lot as a feature makes its way up the source tree. This feature needs a lot more testing still, and we still need to finish the Terminal side of things before it will do anything. I'm sure when it's ready for folks to try out, you'll know 😉 |
- Implements the default application behavior and handoff mechanisms between console and terminal. The inbox portion is done already. This adds the ability for our OpenConsole.exe to accept the incoming server connection from the Windows OS, stand up a PTY session, start the Windows Terminal as a listener for an incoming connection, and then send it the incoming PTY connection for it to launch a tab. - The tab is launched with default settings at the moment. - You must configure the default application using the `conhost.exe` propsheet or with the registry keys. Finishing the setting inside Windows Terminal will be a todo after this is complete. The OS Settings panel work to surface this setting is a dependency delivered by another team and you will not see it here. ## Validation Steps Performed - [x] Manual adjust of registry keys to the delegation conhost/terminal behavior - [x] Adjustment of the delegation options with the propsheet - [x] Launching things from the run box manually and watching them show in Terminal - [x] Launching things from shortcuts and watching them show in the Terminal Documentation on how it works will be a TODO post completion in #9462 References #7414 - Default Terminal spec Closes #492
Implement dropdown menu for choosing a default terminal application from inside the Windows Terminal Settings UI ## PR Checklist * [x] Closes #9463 * [x] I work here. * [x] Manual tests passed * [x] MicrosoftDocs/terminal#314 (and cross reference #9462) ## Detailed Description of the Pull Request / Additional comments - Adds dropdown menu and a template card for displaying the available default applications (using the same lookup code as the console property sheet `console.dll`) - Adds model to TSM for adapting the data for display and binding on XAML - Lookup occurs on every page reload. Persistence only happens on Save Changes. - Manifest changed for Terminal to add capability to opt-out of registry redirection so we can edit this setting ## Validation Steps Performed - [x] Flipped the menu and pressed Save Changes and launched cmd from run box... it moved between the two. - [x] Flipped system theme from light to dark and ensured secondary color looked good - [x] Flipped the status with a different mechanism (conhost propsheet) and then reopened settings page and confirmed it loaded the updated status
yes Windows 11 |
he wasn't kidding after all |
Quick question, is there a way to set a custom terminal by just setting a path to a binary in Using just a path would be nice for portable apps (not installed system-wide), and simplify adding support even for installed apps (currently, at least Alacritty seems unlikely to implement support due to the added complexity of a COM server (alacritty/alacritty#6036)). |
The original mockups for "default terminal" config actually had two parts: "What console handles these requests?" "What terminal does it send them to?" and that's actually still how it works internally. |
It'd be nice if we can use the portable Windows Terminal installation as default terminal. I suppose all the necessary components are already there on the disk, but only the "COM registration" part is missing. |
It looks like |
On a Windows 11 computer that does not have any version of Windows Terminal installed, is there a simple way to set the portable version of Windows Terminal as the Default Terminal? |
@feeas Yes. By modifying registry manually. |
@ysc3839 Can you further explain how to do it? I know that I may need to modify HKEY_CURRENT_USER\Console%%Startup, but the value inside does not point to an exe path. |
@feeas Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{2EACA947-7F5F-4CFA-BA87-8F7FBEEFBE69}\LocalServer32]
@="C:\\terminal-1.21.2361.0\\OpenConsole.exe"
[HKEY_CLASSES_ROOT\CLSID\{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}\LocalServer32]
@="C:\\terminal-1.21.2361.0\\WindowsTerminal.exe"
[HKEY_CLASSES_ROOT\CLSID\{3171DE52-6EFA-4AEF-8A9F-D02BD67E7A4F}\InprocServer32]
@="C:\\terminal-1.21.2361.0\\OpenConsoleProxy.dll"
[HKEY_CLASSES_ROOT\Interface\{59D55CCE-FC8A-48B4-ACE8-0A9286C6557F}\ProxyStubClsid32]
@="{3171DE52-6EFA-4AEF-8A9F-D02BD67E7A4F}"
[HKEY_CLASSES_ROOT\Interface\{746E6BC0-AB05-4E38-AB14-71E86763141F}\ProxyStubClsid32]
@="{3171DE52-6EFA-4AEF-8A9F-D02BD67E7A4F}"
[HKEY_CLASSES_ROOT\Interface\{AA6B364F-4A50-4176-9002-0AE755E7B5EF}\ProxyStubClsid32]
@="{3171DE52-6EFA-4AEF-8A9F-D02BD67E7A4F}"
[HKEY_CLASSES_ROOT\Interface\{E686C757-9A35-4A1C-B3CE-0BCC8B5C69F4}\ProxyStubClsid32]
@="{3171DE52-6EFA-4AEF-8A9F-D02BD67E7A4F}"
Note that you need to modify the file location. Use this to unregister: Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\CLSID\{2EACA947-7F5F-4CFA-BA87-8F7FBEEFBE69}]
[-HKEY_CLASSES_ROOT\CLSID\{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}]
[-HKEY_CLASSES_ROOT\CLSID\{3171DE52-6EFA-4AEF-8A9F-D02BD67E7A4F}]
[-HKEY_CLASSES_ROOT\Interface\{59D55CCE-FC8A-48B4-ACE8-0A9286C6557F}]
[-HKEY_CLASSES_ROOT\Interface\{746E6BC0-AB05-4E38-AB14-71E86763141F}]
[-HKEY_CLASSES_ROOT\Interface\{AA6B364F-4A50-4176-9002-0AE755E7B5EF}]
[-HKEY_CLASSES_ROOT\Interface\{E686C757-9A35-4A1C-B3CE-0BCC8B5C69F4}]
Use this to set default terminal for current user: Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Console\%%Startup]
"DelegationConsole"="{2EACA947-7F5F-4CFA-BA87-8F7FBEEFBE69}"
"DelegationTerminal"="{E12CFF52-A866-4C77-9A90-F570A7AA2C6B}"
|
@ysc3839 Have you tested this reg file? I tested it on two PCs, but both failed. I can see Windows Command Processor and OpenConsole running in Task Manager, but no WindowsTerminal.exe is started. I can launch WindowsTerminal.exe directly, and I’ve confirmed that my path is correct. edited: I resolved the issue by downgrading from version v1.22.2702.0 to v1.21.2701.0. Is this a problem with the new version of Windows Terminal? It's really strange. |
Thank you @ysc3839 ! Those registry works for me. More interestingly, when I open a .cmd or .ps1 file, even though Windows Terminal shows up, from the task manager I can see there is still a cmd.exe there. So it seems like there is some proxying happened. Also, Settings -> System -> For developers -> Terminal doesn't have Windows Terminal as a selectable. |
cmd.exe is the Command Prompt. You should only see it when you launch a .cmd file or Windows Command Prompt. I suspect you are mixing up cmd (the shell) and conhost (the console). Conhost is usually in charge of the window and the keyboard input. In the "default terminal" case, conhost is still running (there are some annoying reasons for this today) but it hands off to another instance of itself called OpenConsole. OpenConsole talks to Terminal. |
I'm sorry I probably misremembered the case before. There is nothing weird about the registry method. Everything works as expected. Is there any chance we can make it more official than a comment in an issue? I'm sure we can include this in the Scoop manifest and make the portable installation more smooth. |
@feeas Version 1.22 uses a new COM interface, I didn't add its interface id to the reg file. @CrendKing The default terminal selection list requires packaged app (AppX or MSIX). |
Do you mean we need a new reg for future versions? |
You just need another interface entry,
|
Thanks for the info. But this doesn't seem to be very future-proof. How to expect a normal user to find out all these obscure interface IDs, let alone to put them in registry? And one day there might be another new interface. I feel this should be treated the same level as how portable mode is treated. The latter at least has a dedicated document page section to explain how it works. If a user is able to create a ".portable" file, surely they can run a "register_windows_terminal_as_default.ps1" if it is provided and maintained by the WT team, right? |
@CrendKing This is for third-party terminal developers to implement a "register as default terminal" function. It's not for end users. |
I'm sorry if I sounded as it is for end user. I was talking about third-party package maintainers. |
@DHowett Could you tell me if adding this will make it work in version 1.22? I tried but it didn't work.
|
@feeas Currently 1.22 is Preview, its CLSID is different from normal version. |
@miniksa and @cinnamon-msft to document how this works.
_Originally posted by @miniksa in #7489
Tasks
The text was updated successfully, but these errors were encountered: