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

Fix persistence of the last closed window #18623

Merged
merged 2 commits into from
Feb 26, 2025

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Feb 24, 2025

Does what it says on the tin.

Closes #18525

Validation Steps Performed

  • Enable persistence
  • Close the last window
  • Persisted ✅

@lhecker lhecker added Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Priority-2 A description (P2) Area-Windowing Window frame, quake mode, tearout labels Feb 24, 2025
@DHowett
Copy link
Member

DHowett commented Feb 24, 2025

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Comment on lines 761 to 762
const auto globalSettings = _app.Logic().Settings().GlobalSettings();
const auto windowLimit = globalSettings.ShouldUsePersistedLayout() ? 1 : 0;
Copy link
Member

Choose a reason for hiding this comment

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

is it important that we keep the logic here separate from _shouldSkipClosingWindows?

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean I should just call _shouldSkipClosingWindows in this function?

Copy link
Member

Choose a reason for hiding this comment

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

that was what I was thinking

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm I'm a little hesitant to do that, because I'm currently very unhappy with this approach and I don't want to codify this weird dependency. As an example, it doesn't consider the existence of the quake window right now.

Copy link
Member Author

Choose a reason for hiding this comment

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

My gut feeling was correct. This PR is completely broken. 😅

@DHowett DHowett merged commit e1be2f4 into main Feb 26, 2025
19 checks passed
@DHowett DHowett deleted the dev/lhecker/non-empty-persistence branch February 26, 2025 19:06
DHowett pushed a commit that referenced this pull request Feb 26, 2025
Does what it says on the tin.

Closes #18525

## Validation Steps Performed
* Enable persistence
* Close the last window
* Persisted ✅

(cherry picked from commit e1be2f4)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXpj9o
Service-Version: 1.23
lhecker added a commit that referenced this pull request Feb 27, 2025
lhecker added a commit that referenced this pull request Feb 28, 2025
The logic didn't work when persistence was enabled and you had 2 windows
and closed the 2nd one, or when dragging the last tab out of the only
window.

## Validation Steps Performed
* 2 windows, close the 2nd one, app doesn't exit ✅
* 1 window, 1 tab, drag the tab out of the window, app doesn't exit ✅
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Windowing Window frame, quake mode, tearout Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Open windows from a previous session" not working due to session not being saved at exit
3 participants