Skip to content

Rely more on profile objects and less on GUIDs - #10982

Merged
Dustin L. Howett (DHowett) merged 3 commits into
mainfrom
dev/duhowett/no-profile-guid
Aug 23, 2021
Merged

Dustin L. Howett (DHowett) merged 3 commits into
mainfrom
dev/duhowett/no-profile-guid

Conversation

@DHowett

@DHowett Dustin L. Howett (DHowett) commented Aug 18, 2021 •

Copy link
Copy Markdown
Member

Right now, we store GUIDs in panes and most of the functions for interacting
with profiles on the settings model take GUIDs and look up profiles.

This pull request changes how we store and look up profiles to prefer profile
objects. Panes store strong references to their originating profiles, which
simplifies settings lookup for CloseOnExit and the bell settings. In fact,
deleting a pane's profile no longer causes it to forget which CloseOnExit
setting applies to it. Duplicating a pane that is hosting a deleted profile
(#5047) now duplicates the profile, even though it is otherwise unreachable.

This makes the world more consistent and allows us to eventually support panes
hosting profiles that do not have GUIDs that can be looked up in the profile
list. This is a gateway to #6776 and #10669, and consolidating the profile
lookup logic will help with #10952.

PR #10588 introduced TerminalSettings::CreateWithProfile and made
...CreateWithProfileByID a thin wrapper over top it, which looked up the profile
by GUID before proceeding. It has also been removed, as its last caller is gone.

Closes #5047

This commit also moves to storing a reference to the active profile
inside Pane and propagating it out of Pane through Tab. This lets us
duplicate a pane even if its profile is missing, and gives us the
freedom in the future to return a "base" profile (;))

Related to #5047.
@DHowett
Dustin L. Howett (DHowett) marked this pull request as ready for review August 19, 2021 16:24

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Loving the progress so far

Comment thread src/cascadia/TerminalApp/TerminalPage.h Resolved
Comment thread src/cascadia/TerminalApp/Pane.cpp Resolved
Comment thread src/cascadia/TerminalApp/Pane.cpp Resolved
Comment thread src/cascadia/TerminalApp/Pane.cpp Resolved
Comment thread src/cascadia/TerminalApp/Pane.cpp Resolved
Comment thread src/cascadia/TerminalApp/Pane.cpp Resolved
@ghost ghost added Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Aug 20, 2021
@DHowett Dustin L. Howett (DHowett) added the Needs-Second It's a PR that needs another sign-off label Aug 20, 2021

@zadjii-msft Mike Griese (zadjii-msft) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

At first I was worried that updating the settings of a profile, then duplicating it wouldn't work with this (we'd just use the old profile object), but no, looks like the code in Pane::updateSettings will still take care of that. So :shipit:

@DHowett

Copy link
Copy Markdown
Member Author

looks like the code in Pane::updateSettings will still take care of that

please help make sure that #10997 keeps that consistency 😄

@ghost

Copy link
Copy Markdown

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

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Second It's a PR that needs another sign-off Priority-3 A description (P3) Product-Terminal The new Windows Terminal.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicating a tab/pane without a valid profile should still duplicate the settings from that tab

3 participants