Skip to content
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

Open
3 tasks
Tracked by #15065 ...
miniksa opened this issue Mar 12, 2021 · 13 comments
Open
3 tasks
Tracked by #15065 ...

[DefApp] Document how it works #9462

miniksa opened this issue Mar 12, 2021 · 13 comments
Labels
Area-DefApp Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Issue-Docs It's a documentation issue that really should be on MicrosoftDocs/Console-Docs Needs-Discussion Something that requires a team discussion before we can proceed Priority-1 A description (P1) Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal.

Comments

@miniksa
Copy link
Member

miniksa commented Mar 12, 2021

@miniksa and @cinnamon-msft to document how this works.

_Originally posted by @miniksa in #7489

Tasks

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Mar 12, 2021
@miniksa miniksa self-assigned this Mar 12, 2021
@miniksa miniksa added Issue-Docs It's a documentation issue that really should be on MicrosoftDocs/Console-Docs Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal. labels Mar 12, 2021
@miniksa miniksa added this to the Terminal v2.0 milestone Mar 12, 2021
@miniksa miniksa added Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. and removed Issue-Task It's a feature request, but it doesn't really need a major design. labels Mar 12, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 12, 2021
@miniksa miniksa removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Mar 12, 2021
@driver1998
Copy link

driver1998 commented Mar 16, 2021

Implements the default application behavior and handoff mechanisms between console and terminal. The inbox portion is done already.

Could you hint us about what Windows version will support this feature?

@zadjii-msft
Copy link
Member

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 😉

DHowett pushed a commit that referenced this issue Mar 26, 2021
- 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
ghost pushed a commit that referenced this issue Apr 28, 2021
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
@just1a-person
Copy link

yes Windows 11

@LuanVSO
Copy link
Contributor

LuanVSO commented Jun 27, 2021

he wasn't kidding after all

@MatejKafka
Copy link

Quick question, is there a way to set a custom terminal by just setting a path to a binary in HKCU/Console/%%Startup (or somewhere else), or does the terminal emulator have to implement a COM server?

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)).

@zadjii-msft
Copy link
Member

as a note to self: contour-terminal/contour#605

Off the top of my head, I don't think this'll be trivial to just point at a exe, instead of a COM server. There's a two-step handoff here, the OS conhost -> a Console server, and then that new console server hands off to a Terminal application.

So alacritty would need to handoff to an OpenConsole (via the commandline somehow), and then that openconsole would need to do the handoff to alacritty. I mean, maybe there's a way to pass those args on the commandline instead of via the COM interface:

er, looking closer at some of those, I feel like, that's maybe less possible

@DHowett
Copy link
Member

DHowett commented May 30, 2023

Here's what I'm thinking, @zadjii-msft.

We always intended 2-stage handoff to be actually 2-part, not just 2-stage. We can provide an updated version of conhost (perhaps even inside terminal!) that other packages can register as their conhost. That will get them the new pty code, and we can complete second-stage handoff to them rather than to Terminal.

Idle notes on why we went with 2-stage handoff:

  • We always wanted to provide conhost as a packaged app for other people to rely on
  • By letting conhost speak conhost to conhost, it decouples the PTY handoff interface from the OS

@DHowett
Copy link
Member

DHowett commented May 30, 2023

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.

@CrendKing
Copy link

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.

@ysc3839
Copy link
Contributor

ysc3839 commented Sep 20, 2024

It looks like OpenConsoleProxy.dll is required to do marshaling.
If I implement terminal handoff in my app, and register OpenConsoleProxy.dll in HKEY_CLASSES_ROOT, would it conflict with the one in Windows Terminal?

@lhecker lhecker added the Needs-Discussion Something that requires a team discussion before we can proceed label Sep 23, 2024
@feeas
Copy link

feeas commented Oct 4, 2024

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?

@ysc3839
Copy link
Contributor

ysc3839 commented Oct 4, 2024

@feeas Yes. By modifying registry manually.

@feeas
Copy link

feeas commented Oct 4, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-DefApp Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Issue-Docs It's a documentation issue that really should be on MicrosoftDocs/Console-Docs Needs-Discussion Something that requires a team discussion before we can proceed Priority-1 A description (P1) Product-Conhost For issues in the Console codebase Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests