Any time we take a profile GUID, consider taking a profile name #5144

Closed
opened 2026-01-31 00:06:08 +00:00 by claunia · 5 comments
Owner

Originally created by @DHowett-MSFT on GitHub (Nov 23, 2019).

starts with { = guid, and we'll need a helper that looks in your profile list for a name and turns it into a guid. This'll allow people to specify guidless profiles in future key bindings that let you specify guids, as well as in defaultProfile

Originally created by @DHowett-MSFT on GitHub (Nov 23, 2019). starts with `{` = guid, and we'll need a helper that looks in your profile list for a name and turns it into a guid. This'll allow people to specify guidless profiles in future key bindings that let you specify guids, as well as in `defaultProfile`
Author
Owner

@DHowett-MSFT commented on GitHub (Nov 23, 2019):

If somebody names their profile {something that looks like a guid}, I mean, that's their own fault.

@DHowett-MSFT commented on GitHub (Nov 23, 2019): If somebody names their profile `{something that looks like a guid}`, I mean, that's their own fault.
Author
Owner

@zadjii-msft commented on GitHub (Nov 25, 2019):

If somebody names their profile {something that looks like a guid}, I mean, that's their own fault.

If we fail to parse a GUID, we can always just fall back to looking up a name. Though I suppose if someone names their profile {an-actual-guid}, that's just begging for things to not work right.

@zadjii-msft commented on GitHub (Nov 25, 2019): > > > If somebody names their profile `{something that looks like a guid}`, I mean, that's their own fault. If we fail to parse a GUID, we can always just fall back to looking up a name. Though I suppose if someone names their profile `{an-actual-guid}`, that's just begging for things to not work right.
Author
Owner

@mkitzan commented on GitHub (Nov 27, 2019):

@DHowett-MSFT I can add a helper function in CascadiaSettings which takes a wstring profile name and returns a GUID, if there's a match. Is this kind of what you're thinking with this one?

@mkitzan commented on GitHub (Nov 27, 2019): @DHowett-MSFT I can add a helper function in `CascadiaSettings` which takes a `wstring` profile name and returns a `GUID`, if there's a match. Is this kind of what you're thinking with this one?
Author
Owner

@DHowett-MSFT commented on GitHub (Nov 28, 2019):

@mkitzan yep! I'd be careful though: @zadjii-msft is probably going to be working in this area soon, but you might beat him to it 😄

@DHowett-MSFT commented on GitHub (Nov 28, 2019): @mkitzan yep! I'd be careful though: @zadjii-msft is probably going to be working in this area _soon_, but you might beat him to it :smile:
Author
Owner

@mkitzan commented on GitHub (Nov 28, 2019):

@DHowett I've got the helper implemented which I can open a PR for. However, when looking at Profile, I found a function GetGuid marked noexcept which throws if the GUID is illegitimate. Many noexcept functions in CascadiaSettings use this function. Could be a bad time if this were to throw. Is the dev team aware of this/purposely did this? If not, I can open an issue and fix the noexcept labels (or just make the fix in the PR for this issue). Edit: I'm just going to open an issue for this.

@mkitzan commented on GitHub (Nov 28, 2019): @DHowett I've got the helper implemented which I can open a PR for. However, when looking at `Profile`, I found a function [`GetGuid`](https://github.com/microsoft/terminal/blob/master/src/cascadia/TerminalApp/Profile.cpp#L141) marked `noexcept` which throws if the GUID is illegitimate. Many `noexcept` functions in `CascadiaSettings` use this function. Could be a bad time if this were to throw. Is the dev team aware of this/purposely did this? ~If not, I can open an issue and fix the `noexcept` labels (or just make the fix in the PR for this issue).~ Edit: I'm just going to open an issue for this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5144