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

[DxD] Add 'Automatic' as a mode for CloseOnExit #13560

Merged
8 commits merged into from
Aug 1, 2022
Merged

Conversation

PankajBhojwani
Copy link
Contributor

@PankajBhojwani PankajBhojwani commented Jul 21, 2022

Summary of the Pull Request

Adds a new mode to CloseOnExit: Automatic. In this mode, if a process handed off by defterm terminates for whatever reason, we always close (i.e. we treat the mode as Always), but for processes launched by Terminal we terminate as with the Graceful behaviour.

PR Checklist

  • Closes [DxD] closeOnExit should be sensible when launched via defterm #13325
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Documentation updated. If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated.
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Detailed Description of the Pull Request / Additional comments

  • Adds a new enum value to CloseOnExit
  • Adds a new function to Pane: FinalizeConfigurationGivenDefault: this is a function that should be called when the pane is created via default terminal handoff, and can contain any special configurations we should set given that the pane was created via handoff

Validation Steps Performed

@ghost ghost added Area-DefApp Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. labels Jul 21, 2022
Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

Plumbing wise this is all great, but let's workshop the naming / phrasing

@zadjii-msft zadjii-msft added the Needs-Discussion Something that requires a team discussion before we can proceed label Jul 22, 2022
Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

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

  • update the schema plz
  • update the docs plz
  • update defaults.json (we're setting closeOnExit there) (check userDefaults.json too)

@ghost ghost added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jul 22, 2022
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@carlos-zamora carlos-zamora removed the Needs-Discussion Something that requires a team discussion before we can proceed label Jul 25, 2022
@PankajBhojwani
Copy link
Contributor Author

@carlos-zamora I've updated the schema and the defaults, will get to the docs after the PR merges

@DHowett
Copy link
Member

DHowett commented Jul 29, 2022

Please make sure you update the pull request title and body to reflect what we settled on / what the PR actually does!

@PankajBhojwani PankajBhojwani changed the title [DxD] Add 'GracefulIfLaunchedByTerminal' as a mode for CloseOnExit [DxD] Add 'Automatic' as a mode for CloseOnExit Jul 29, 2022
Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

Guys lemme tell you, I missed the discussion where you came up with "automatic" but I friggen love it

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Aug 1, 2022
@ghost
Copy link

ghost commented Aug 1, 2022

Hello @zadjii-msft!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

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 (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 89d57e8 into main Aug 1, 2022
@ghost ghost deleted the dev/pabhoj/dxd_close branch August 1, 2022 21:11
@DHowett
Copy link
Member

DHowett commented Aug 1, 2022

Hey, since you're storing default terminal state on the pane... have you made absolutely certain it propagates to the correct child if you split it? And goes back up to the parent when you un-split it? This seems potentially risky to manage as pane specific state.

@DHowett
Copy link
Member

DHowett commented Aug 1, 2022

I can confirm that no, it doesn't work once you split the pane. ☹️

ghost pushed a commit that referenced this pull request Aug 4, 2022
## Summary of the Pull Request
In #13560 we added a member to `Pane` that lets it know if it was spawned as a default terminal session, but did not propagate that value when the pane gets split or when the pane closes. This commit fixes that. 

## Validation Steps Performed
A session spawned by a def term invocation remembers it even as it goes through splits
DHowett pushed a commit that referenced this pull request Aug 8, 2022
## Summary of the Pull Request
Adds a new mode to `CloseOnExit`: `Automatic`. In this mode, if a process handed off by defterm terminates for whatever reason, we always close (i.e. we treat the mode as `Always`), but for processes launched by Terminal we terminate as with the `Graceful` behaviour.

## PR Checklist
* [x] Closes #13325
* [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
* [ ] Schema updated.
* [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

## Detailed Description of the Pull Request / Additional comments

- Adds a new enum value to `CloseOnExit`
- Adds a new function to `Pane`: `FinalizeConfigurationGivenDefault`: this is a function that should be called when the pane is created via default terminal handoff, and can contain any special configurations we should set given that the pane was created via handoff

## Validation Steps Performed

(cherry picked from commit 89d57e8)
Service-Card-Id: 84836029
Service-Version: 1.15
DHowett pushed a commit that referenced this pull request Aug 8, 2022
## Summary of the Pull Request
In #13560 we added a member to `Pane` that lets it know if it was spawned as a default terminal session, but did not propagate that value when the pane gets split or when the pane closes. This commit fixes that.

## Validation Steps Performed
A session spawned by a def term invocation remembers it even as it goes through splits

(cherry picked from commit 1a77834)
Service-Card-Id: 84836635
Service-Version: 1.15
@ghost
Copy link

ghost commented Aug 17, 2022

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

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-DefApp AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-1 A description (P1) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DxD] closeOnExit should be sensible when launched via defterm
5 participants