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

Feature Request: Task Bar jumplist should show items from profile #576

Closed
RobCannon opened this issue May 8, 2019 · 45 comments · Fixed by #7515
Closed

Feature Request: Task Bar jumplist should show items from profile #576

RobCannon opened this issue May 8, 2019 · 45 comments · Fixed by #7515
Assignees
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. 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

@RobCannon
Copy link

The Task Bar context menu

image

should show the items from the configured profiles that populate the new shell menu

image

@HBelusca
Copy link
Contributor

HBelusca commented May 8, 2019

"DOS but not DOS" .... 🤔

@RobCannon
Copy link
Author

I just grabbed that screen shot from the blog post by @shanselman. His icons look better than mine!

@fcharlie
Copy link
Contributor

fcharlie commented May 8, 2019

@RobCannon The icon on the menu needs to be 32x32.
The icon for this console happens to be 32x32 bit 👇
https://github.com/microsoft/Terminal/blob/master/src/host/exe/console.ico

https://iconverticons.com/online/ Convert to 32x32 icon/png

This is the small icon I made: icons.zip

屏幕截图(1)

@zadjii-msft
Copy link
Member

This is a really good idea

@zadjii-msft zadjii-msft added Help Wanted We encourage anyone to jump in on these. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels May 8, 2019
@zadjii-msft zadjii-msft added this to the Windows Terminal v1.0 milestone May 8, 2019
@Jarvis73
Copy link

Jarvis73 commented May 9, 2019

@fcharlie How can I add icons to the shell list just like that in your picture?

@fcharlie
Copy link
Contributor

fcharlie commented May 9, 2019

@Jarvis73 Modify profile.json,
Look: A new Console for Windows - It's the open source Windows Terminal
https://gist.github.com/shanselman/221ef38d035fcf2836d664009f144eac

@Jarvis73
Copy link

Jarvis73 commented May 9, 2019

@fcharlie Perfect!

@mdtauk
Copy link

mdtauk commented May 9, 2019

This context menu is called the Jumplist, for anyone planning to add this functionality in a PR

@DHowett-MSFT DHowett-MSFT changed the title Feature Request: Task Bar menu should show items from profile Feature Request: Task Bar jumplist should show items from profile May 9, 2019
@topkecleon
Copy link

The jump list should also feature an option to launch Terminal as an administrator.

There has been discussion in other issues (#146, #632) as to why individual tabs can't be administrative, but a lumplist option to launch the whole program as administrator, like PowerShell or cmd, would be great.

@berwyn
Copy link

berwyn commented May 10, 2019

If you guys wouldn't mind, I'd love to take a stab at this!

@miniksa
Copy link
Member

miniksa commented May 10, 2019

@berwyn, presuming that the scope of what you're attempting to take on is:

  • Determine how to register a jump list inside the TerminalApp project
  • Only listing the items in the jump list that would already otherwise be accessible from the + dropdown menu

Then I am OK with you proceeding on this and I will assign you. If things start to get outside the proposal or off the rails, please consult with us here before going further.

Disclaimer: You're going to be among the first people we assign to do a feature that aren't on our direct team. It might be rough and neither we nor you know exactly what to expect. Bear with us. We're learning how to be open as much as you're learning how to work in our code. A few notes to take with you as you go:

  1. Try to match the style of where you're working. Try Modern C++ practices. Try to use WIL/GSL referencing other example usages. Try to add TAEF tests when/if you can (we know the Terminal project is rough here right now).
  2. Be ready for a back-and-forth on PR or for us to generate a bunch of "new rules" or "regulations" as an outcome of this experience.
  3. We're as excited as you are to have this be open, but please only expect our promptish responses M-F 8am-5pm Pacific Daylight Time. Be patient otherwise, we're coming back to you. We just like our families and friends and sleep and we're honestly overwhelmed with the amount of traffic we have received in the last 3 days and are struggling to keep up.

Fair?

@berwyn
Copy link

berwyn commented May 10, 2019

I am 100% onboard with being a guinea pig for external contributions! And, indeed, I was planning to only introduce the profile items in the flyout to the jumplist.

@shanselman
Copy link
Member

@HBelusca I called it that (in my own profile) because cmd.exe isn't DOS, but it is.

@zadjii-msft
Copy link
Member

zadjii-msft commented May 10, 2019

@berwyn to add:

I'd probably do the jumplist in the WindowsTerminal project - we're trying to keep the UWP-like code in TerminalApp and the Win32-like code in WindowsTerminal. See src/cascadia/WindowsTerminal/AppHost.cpp for a place to start. You should be able to add methods to App to be able to query something like the profiles. Here be dragons though, the Profiles are not a C++/WinRT type, so they probably won't be exposable directly through the .idl. I can provide guidance here if you need help

@berwyn
Copy link

berwyn commented May 10, 2019

@zadjii-msft I may open a draft PR today for this, but I actually met with great success creating the jumplist and its entries, introducing a method IAsyncAction App::_CreateJumplist() that's invoked immediately following App::_CreateNewTabFlyout(). Where I'm struggling is on responding to the actual click events on the jumplist items.

On a straight UWP, it seems like the Windows::UI::Xaml::StartScreen helpers create links that are intended to be handled by the App::OnLaunched(LaunchedEventArgs const&). I dropped in an appropriate function on App before it occurred to me that the desktop bridge may or may not actually connect those events. As of right now, the breakpoints I've set there were never hit and I'm not sure if that's just my inexperience debugging C++ and/or WinRT, or if there's some linkage issue due to the desktop bridge.

I've also never touched UWP with C++, so it's a learning process in that regard, do I need to declare lifecycle functions in the idl? Because that could also be the problem here (and that only just ocurred to me as I'm tying this).

@zadjii-msft
Copy link
Member

Oh yikes, that might be a harder problem that we thought then.

As you've discovered, we're not really a real UWP, we're a Win32 application. Our App.cpp/h/idl/xaml is not a real UWP "App" in this sense (it's actually just a trick to get XAML to work right for XAML Islands applications. I'm fairly certain (@DHowett-MSFT call me out if I'm wrong) even if you put Onlaunched in the idl, it wouldn't be called, because the application is getting activated as a traditional Win32 application.

So, how could we still make this work?

I don't really know how jumplists work, but if they let you specify commandline args, then maybe you could pass a --profile <guid> to wt.exe, and then parse the commandline in WindowsTerminal/main.cpp. Then, when creating the App, you'd pass the initial profile to the constructor. That's one option. Commandline args are something we want to add eventually, so you'd be the one to put some of the basics in place.

@miniksa any other ideas? I feel like there's gotta be an easier solution out there somewhere.

@berwyn
Copy link

berwyn commented May 10, 2019

I had that thought was well, and it's the direction I started sniffing in last night but didn't get much of a chance to dig into it. Barring any other ideas that crop up, is there a good reference I could look at for handling commandline args in a Microsoft-approved manner? Maybe something in ConHost that could (I assume ConsoleArguments) that could be brushed up and pulled into the shared bits?

@zadjii-msft
Copy link
Member

ConsoleArguments is where I'd start.

IIRC there was talk of adding getopt to the windows sdk (or CRT I don't remember) at some point, but idk if that ever actually happened or not.

@miniksa
Copy link
Member

miniksa commented May 10, 2019

For the arguments part, I agree. Go ahead and abstract/derive/baseclass/reuse ConsoleArguments into a shared component.

Probably into the Types one given its our grab bag of useful utilities shared across half-past everything.

Also, I'm doing some research into how jump lists work now to try to give you better advice. By what mechanism did you register the jump list? Is there some UWP/WinRT API to do it?

@berwyn
Copy link

berwyn commented May 10, 2019

I leveraged the WinRT helpers to create the items, since that's on the list of APIs exposed to desktop bridge apps. I haven't had a chance to play with passing a full executable with args in for the arguments parameter, but it does seem to accept any arbitrary parameter.

I'll pop open a draft PR once I get home and have my hands on the code, should make it easier to discuss/iterate on the code.

@miniksa
Copy link
Member

miniksa commented May 10, 2019

OK, reading that documentation, I think that figuring out how to catch the arguments coming in on the initial wmain and probably figuring out how to single-instance or communicate with the existing running process are going to be the challenges here.

I was hoping Jump List registration also included an eventing callback that would be fired in the same process it was registered from, but that seems to be not true. It just seems to be a registration that tells the shell to CreateProcess/ShellExecute something and maybe with arguments.

berwyn added a commit to berwyn/Terminal that referenced this issue May 10, 2019
@berwyn
Copy link

berwyn commented May 10, 2019

Alright, I've opened a draft (#689) to track progress on this. So far, it's just my first attempt at getting the items into the jumplist. I'll probably take some time this weekend to have a stab at parsing the commandline and launching tabs

@gamagan
Copy link

gamagan commented Jul 31, 2020

I haven't seen it mentioned specifically in this thread; please keep in mind this feature, of pinning script-files to jump list:
#5261

@ghost
Copy link

ghost commented Aug 20, 2020

I consider this a very necessary feature. Many times I don't want to launch the default when I launch terminal so it just wastes time to have to launch it to open a tab I don't need and then launch another tab.

ConEmu has jumplist functionality and I use it constantly.

@clarkezone
Copy link
Contributor

clarkezone commented Aug 20, 2020 via email

@zadjii-msft
Copy link
Member

Not yet. I believe it's next up on @leonMSFT's todo list - hence why it's in the 1.4 milestone.

@clarkezone
Copy link
Contributor

If you need help happy to take a stab.

@ghost ghost added the In-PR This issue has a related PR label Sep 2, 2020
@ghost ghost closed this as completed in #7515 Sep 3, 2020
@ghost ghost removed the In-PR This issue has a related PR label Sep 3, 2020
ghost pushed a commit that referenced this issue Sep 3, 2020
This commit introduces Jumplist customization and an item for each
profile to the Jumplist. Selecting an entry in the jumplist will pretty
much just execute  `wt.exe -p "{profile guid}"`, and so a new Terminal
will open with the selected profile.

Closes #576
@ghost ghost added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Sep 3, 2020
@ghost
Copy link

ghost commented Sep 22, 2020

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

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. 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
Development

Successfully merging a pull request may close this issue.