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

Add a information popup about default terminals #11397

Merged
5 commits merged into from
Oct 7, 2021

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Oct 2, 2021

This commit adds a simple information popup about default terminals,
guiding first-time Windows 11 users into changing the default terminal.

Validation Steps Performed

  • Info bar pops up on Windows 11 ✔️
  • Info bar can be dismissed persistently ✔️

@lhecker lhecker marked this pull request as draft October 2, 2021 00:05
@lhecker lhecker force-pushed the dev/lhecker/default-terminal-popup branch from 85f5639 to 752ab6c Compare October 2, 2021 00:06
}

dismissedMessages.Append(message);
ApplicationState::SharedInstance().DismissedMessages(dismissedMessages);
applicationState.DismissedMessages(std::move(messages));
Copy link
Member Author

@lhecker lhecker Oct 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI This fixes a pretty ugly programming error: ApplicationState is supposed to be a thread-safe class.
Calling Append on the returned vector however isn't thread-safe, so I rewrote this.

Comment on lines 721 to 723
<data name="SetAsDefaultInfoBar.Message" xml:space="preserve">
<value>Windows Terminal can be set as your default terminal application in your settings.</value>
</data>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Offline discussion w/ @cinnamon-msft ) "Looks good"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love the repeated "your". "the settings" is better, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to

Windows Terminal can be set as the default terminal application in your settings.

Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(storing the point that I've reviewed so far)

@lhecker lhecker marked this pull request as ready for review October 2, 2021 00:37
@@ -287,6 +287,11 @@ namespace winrt::TerminalApp::implementation
_defaultPointerCursor = CoreWindow::GetForCurrentThread().PointerCursor();
}
CATCH_LOG();

if (CascadiaSettings::IsDefaultTerminalAvailable())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to add a check here that only makes it show up if conhost is the current default:

if (CascadiaSettings::IsDefaultTerminalAvailable() && !_settings.CurrentDefaultTerminal())

But unfortunately the Name() returned by CurrentDefaultTerminal() is always a localized name of the application including conhost. So I'd have to add some new API functions to make this work.

But before I do that I wanted to ask if anyone else would like to see that...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will probably want to hide this infobar if we're not running packaged, also. which is silly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we just change IsDefaultTerminalAvailable to detect unpackaged activation then?

@zadjii-msft zadjii-msft added zPreview-Service-Queued-1.13 A floating label that tracks the current Preview version for servicing purposes. zStable-Service-Queued-1.12 A floating label that tracks the current Stable version for servicing purposes. zBugBash-Consider labels Oct 4, 2021
@DHowett
Copy link
Member

DHowett commented Oct 5, 2021

Mind sharing a screenshot? 😄

@lhecker
Copy link
Member Author

lhecker commented Oct 6, 2021

@DHowett Is it fine as just a regular comment here?
N4HUNYivGMA2RNRH

@DHowett
Copy link
Member

DHowett commented Oct 6, 2021

Love it!

In fact, I prefer screenshots to be outside of the commit body. Github does not render commit bodies in markdown, so... they look messy and the user has to dig out a URL and open it themselves just to see it.

@DHowett
Copy link
Member

DHowett commented Oct 6, 2021

As a big trick, you could expose the DelegationConfig's TerminalGuid and compare it against the hardcoded "self guid" (check out the defines in CTerminalHandoff) or against the hardcoded null guid 😄

@lhecker
Copy link
Member Author

lhecker commented Oct 6, 2021

@DHowett I've updated the PR with your suggestions. Can you check the latest commit again if you get a chance?

@DHowett DHowett added the AutoMerge Marked for automatic merge by the bot when requirements are met label Oct 7, 2021
@ghost
Copy link

ghost commented Oct 7, 2021

Hello @DHowett!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 2b1468e into main Oct 7, 2021
@ghost ghost deleted the dev/lhecker/default-terminal-popup branch October 7, 2021 17:44
@DHowett DHowett removed the zPreview-Service-Queued-1.13 A floating label that tracks the current Preview version for servicing purposes. label Oct 11, 2021
@PankajBhojwani PankajBhojwani removed the zStable-Service-Queued-1.12 A floating label that tracks the current Stable version for servicing purposes. label Oct 13, 2021
DHowett pushed a commit that referenced this pull request Oct 13, 2021
This commit adds a simple information popup about default terminals,
guiding first-time Windows 11 users into changing the default terminal.

* Info bar pops up on Windows 11 ✔️
* Info bar can be dismissed persistently ✔️

(cherry picked from commit 2b1468e)
@ghost
Copy link

ghost commented Oct 20, 2021

🎉Windows Terminal v1.11.2921.0 has been released which incorporates this pull request.:tada:

Handy links:

@ghost
Copy link

ghost commented Oct 20, 2021

🎉Windows Terminal Preview v1.12.2922.0 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoMerge Marked for automatic merge by the bot when requirements are met zBugBash-Consider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants