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] Pass LNK/EXE data from OpenCon to ITerminalHandoff #9458

Closed
Tracked by #13392
miniksa opened this issue Mar 11, 2021 · 5 comments · Fixed by #11390 or #13570
Closed
Tracked by #13392

[DefApp] Pass LNK/EXE data from OpenCon to ITerminalHandoff #9458

miniksa opened this issue Mar 11, 2021 · 5 comments · Fixed by #11390 or #13570
Assignees
Labels
Area-DefApp Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@miniksa
Copy link
Member

miniksa commented Mar 11, 2021

brain notes from chat

if we get the lnk filename or the exe path from ITerminalHandoff, we can cobble together a fake profile (based on the console settings in the lnk or registry) that "looks-like-" what conhost would have looked like for that lnk or exe

Originally posted by @DHowett in #7489 (comment)

@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 11, 2021
@miniksa miniksa self-assigned this Mar 11, 2021
@miniksa miniksa added Area-Server Down in the muck of API call servicing, interprocess communication, eventing, etc. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. labels Mar 11, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 11, 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 11, 2021
@miniksa miniksa added this to the Terminal v1.9 milestone Mar 11, 2021
@ghost ghost added the In-PR This issue has a related PR label Oct 1, 2021
@ghost ghost closed this as completed in #11390 Oct 8, 2021
@ghost ghost removed the In-PR This issue has a related PR label Oct 8, 2021
@ghost ghost added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Oct 8, 2021
ghost pushed a commit that referenced this issue Oct 8, 2021
This implements command line matching for `CascadiaSettings::GetProfileForArgs`.
The command lines for all user profiles are resolved to absolute file paths,
argument quotes are standardized ("canonicalized") and the results are cached.

When `GetProfileForArgs` is called with a Commandline() value, we "canonicalize"
the argument as well and find the profile that is the longest prefix.
If none could be found the default profile is returned.

## PR Checklist
* [x] Closes #9458
* [x] Closes #10952
* [x] I work here
* [ ] Tests added/passed

## Validation Steps Performed

* Open a `cmd.exe` tab in the store-version of WT
* Run `start cmd`
  --> A tab with the `cmd.exe` profile opens
* Run `start pwsh.exe`
  --> A tab with the PowerShell 7 profile opens
* Run PowerShell 7 from the start menu
  --> A tab with the PowerShell 7 profile opens
* Create a symlink for PowerShell 7 and launch `pwsh.exe` from there
  --> A tab with the PowerShell 7 profile opens
@ghost
Copy link

ghost commented Oct 20, 2021

🎉This issue was addressed in #11390, which has now been successfully released as Windows Terminal Preview v1.12.2922.0.:tada:

Handy links:

@zadjii-msft
Copy link
Member

Ahg I hate to be a pain, but I don't think we technically did this one. I think a big part of this one is the "if we're launched from a .lnk, we need to crack that lnk open and create a dummy profile for those settings". Or at least we need to experiment with trying that. It's a very 98052 issue, but one I bet we're gonna hear a few more times this year.

also related: #1793

@zadjii-msft zadjii-msft reopened this Feb 25, 2022
@zadjii-msft zadjii-msft modified the milestones: Terminal v2.0, Backlog Feb 25, 2022
@zadjii-msft zadjii-msft removed the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Feb 25, 2022
@miniksa
Copy link
Member Author

miniksa commented Mar 10, 2022

What happened was that I believe I added the information to do this to the interface so it could be implemented, but then never actually used that information to implement anything.

zadjii-msft added a commit that referenced this issue Jul 19, 2022
  This hooks up the defterm interface to pass more info along in the startup. It's notably not the actual link title, but it does work from a plumbing standpoint

  This is for #9458
@zadjii-msft zadjii-msft self-assigned this Jul 19, 2022
@ghost ghost added the In-PR This issue has a related PR label Jul 22, 2022
zadjii-msft added a commit that referenced this issue Aug 26, 2022
This PR by itself doesn't _really_ change much. Technically, now the Terminal will respect the Title of a `.lnk` when started for defterm, but we don't do anything else yet. Primarily, the goal of this PR is to just wire up startup info in OpenConsole to the connected Terminal. 
* This required a bit of changes in `srvinit.cpp:ConsoleEstablishHandoff` to replicate other bits of startup, where we crack open the connect message to get the relevant bits of info.
* We pack that all into a `TERMINAL_STARTUP_INFO`, which we pass along to the registered terminal application.
* `ConptyConnection` accepts the handoff, and gathers that information out of the `TERMINAL_STARTUP_INFO`
* Some other updates to the scratch sln were made to make it build again (related, but unimportant).
* This is a precursor to:
  * #13111
  * #12154
* Closes #9458
* Tested manually
* I work here
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. Needs-Tag-Fix Doesn't match tag requirements and removed In-PR This issue has a related PR labels Aug 26, 2022
@ghost
Copy link

ghost commented Sep 13, 2022

🎉This issue was addressed in #13570, which has now been successfully released as Windows Terminal Preview v1.16.252.:tada:

Handy links:

DHowett pushed a commit that referenced this issue Oct 14, 2022
This PR by itself doesn't _really_ change much. Technically, now the Terminal will respect the Title of a `.lnk` when started for defterm, but we don't do anything else yet. Primarily, the goal of this PR is to just wire up startup info in OpenConsole to the connected Terminal.
* This required a bit of changes in `srvinit.cpp:ConsoleEstablishHandoff` to replicate other bits of startup, where we crack open the connect message to get the relevant bits of info.
* We pack that all into a `TERMINAL_STARTUP_INFO`, which we pass along to the registered terminal application.
* `ConptyConnection` accepts the handoff, and gathers that information out of the `TERMINAL_STARTUP_INFO`
* Some other updates to the scratch sln were made to make it build again (related, but unimportant).
* This is a precursor to:
  * #13111
  * #12154
* Closes #9458
* Tested manually
* I work here

(cherry picked from commit 7e47f6a)
Service-Card-Id: 86230565
Service-Version: 1.15
@ghost
Copy link

ghost commented Oct 18, 2022

🎉This issue was addressed in #13570, which has now been successfully released as Windows Terminal v1.15.2874.:tada:

Handy links:

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-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
3 participants