-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Implement UI for choosing default terminal inside Settings page #9907
Conversation
This comment has been minimized.
This comment has been minimized.
src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw
Outdated
Show resolved
Hide resolved
src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj
Outdated
Show resolved
Hide resolved
reg.exe |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
Check what reg.exe do when key is missing. |
wil::unique_cotaskmem_string str; | ||
RETURN_IF_FAILED(StringFromCLSID(clsid, &str)); | ||
|
||
auto regExePath = wil::ExpandEnvironmentStringsW<std::wstring>(L"%WINDIR%\\System32\\reg.exe"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically we can GetSystemDirectory
(for which wil has a wrapper) -- might be (delta) "easier"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like making one more call and concatenate.... I think I'll just leave it this way especially since I stole this from another part of our codebase already (and subbed the exe name)
It just works. Makes the tree of keys and puts the key/value pair in. Good enough. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea these are just nits. Check the theming thing though, and watch out for #9716
return _current.value(); | ||
} | ||
|
||
void DefaultTerminal::Current(const Model::DefaultTerminal& term) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd maybe add a doc comment here that this will write to the registry. Everything else in this class are all just reads, but this one's a write.
hstring Version() const; | ||
hstring Icon() const; | ||
|
||
static void Refresh(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit: this can be private, right?
// - <none> | ||
void CascadiaSettings::CurrentDefaultTerminal(winrt::Microsoft::Terminal::Settings::Model::DefaultTerminal terminal) | ||
{ | ||
_currentDefaultTerminal = terminal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe note that this doesn't write the defterm choice to the registry, it just sets the value internally, and that the value is persisted to the reg in CascadiaSettings::WriteSettingsToDisk
|
||
<TextBlock Grid.Row="1" | ||
Grid.Column="1" | ||
Foreground="{StaticResource SystemBaseMediumColor}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work in both dark and light mode? What if the OS is set to dark mode, but the app is set to light?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked OS set to light and OS set to dark with the app following. If you switch it while it is open, it looks terrible. But if you close and reopen the page it's fine. I wasn't going to cry over that.
I can check and cross-reference the other bug I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meh,
Hello @zadjii-msft! Because this pull request has the 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 (
|
Just to be sure- we didn't fix the truncated version number on the right side, right? |
<Grid.ColumnDefinitions>
<!-- icon -->
<ColumnDefinition Width="24" />
<!-- profile name and author -->
<ColumnDefinition Width="*" />
<!-- version -->
<ColumnDefinition Width="48" />
</Grid.ColumnDefinitions> Hmm... Doesn't look like it. We could add a TextTrimming property to the TextBlock to truncate the version instead of clipping it. |
🎉 Handy links: |
I absolutely love that this possibility is coming, so thanks a ton everyone for all the work on this. I have a question though, and maybe it's obvious, but I was kind of expecting this setting to be in "Windows Settings -> Apps -> Default apps", which is this menu here: click to expand large-ish screenshot: Is that planned at all by / with the Windows team or is it the end-goal to permanently host the setting inside the Windows Terminal settings UI? |
🎉 Handy links: |
If it matters and relevant, I'm running 1.11.211019001-release1.11 on W10-19042.685 and there is no such option in the menu. On first launch of new version no pop-up appeared either. |
Yep, that's by design. Defterm only works on Windows 11. |
AH! Another thing: When Terminal is installed in a directory by extracting the archive (which scoop does!), there are required OS registration steps that get skipped. |
I see. The release notes were written in such way that it implies the Windows 11 sub-remark was just describing different behavior on Windows 11 and the main bulletpoint applied in general to all supportsed OSes. |
Thanks, we should clarify that! |
Will the defterm functionality be added to Win10 in the future? |
Nope. That feature is going to remain a Windows 11-only feature. It's powered by a fairly large feature change to the OS, which is unlikely to be serviced as a "bugfix" to earlier OS versions. |
Implement dropdown menu for choosing a default terminal application from inside the Windows Terminal Settings UI
PR Checklist
Detailed Description of the Pull Request / Additional comments
console.dll
)Validation Steps Performed