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

Make sure Terminal Stable shows up as default on 22544+ #12320

Merged
1 commit merged into from
Feb 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/internal/stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,16 @@ void EdpPolicy::AuditClipboard(const std::wstring_view /*destinationName*/) noex

[[nodiscard]] HRESULT DefaultApp::CheckShouldTerminalBeDefault(bool& isEnabled) noexcept
{
// False since setting Terminal as the default app is an OS feature and probably
// should not be done in the open source conhost. We can always decide to turn it
// on in the future though.
isEnabled = false;
// Since we toggled this feature on in Windows, Terminal (and Terminal Preview) need to
// agree -- otherwise, they will present UI that suggests Terminal is NOT the default,
// like the info bar.
OSVERSIONINFOEXW osver{};
osver.dwOSVersionInfoSize = sizeof(osver);
osver.dwBuildNumber = 22544;

DWORDLONG dwlConditionMask = 0;
VER_SET_CONDITION(dwlConditionMask, VER_BUILDNUMBER, VER_GREATER_EQUAL);

isEnabled = VerifyVersionInfoW(&osver, VER_BUILDNUMBER, dwlConditionMask) != FALSE;
return S_OK;
}