Skip to content

Commit

Permalink
Don't explode if HKCU\Console is write-protected (#15916)
Browse files Browse the repository at this point in the history
I manually changed the permissions on `HKCU\Console` to deny "Create
subkey" to myself. Then confirmed that it explodes before this change,
and not after this change.

Closes #15458
  • Loading branch information
zadjii-msft authored Sep 5, 2023
1 parent b53ddd1 commit 6cff135
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cascadia/TerminalSettingsModel/DefaultTerminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ bool DefaultTerminal::HasCurrent()

void DefaultTerminal::Current(const Model::DefaultTerminal& term)
{
THROW_IF_FAILED(DelegationConfig::s_SetDefaultByPackage(winrt::get_self<DefaultTerminal>(term)->_pkg));
// Just log if we fail to write the defterm configuration. It's not worth
// exploding over if the regkey is write-protected or something.
LOG_IF_FAILED(DelegationConfig::s_SetDefaultByPackage(winrt::get_self<DefaultTerminal>(term)->_pkg));

TraceLoggingWrite(g_hSettingsModelProvider,
"DefaultTerminalChanged",
Expand Down

0 comments on commit 6cff135

Please sign in to comment.