Skip to content

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

Merged
8 commits merged into
mainfrom
dev/pabhoj/dxd_close
Aug 1, 2022
Merged

8 commits merged into
mainfrom
dev/pabhoj/dxd_close

Conversation

@PankajBhojwani

@PankajBhojwani PankajBhojwani commented Jul 21, 2022 •

Copy link
Copy Markdown
Contributor

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
Comment thread src/cascadia/TerminalApp/Pane.cpp Resolved

@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.

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

Comment thread src/cascadia/TerminalApp/Pane.cpp Resolved
@zadjii-msft Mike Griese (zadjii-msft) added the Needs-Discussion Something that requires a team discussion before we can proceed label Jul 22, 2022

@carlos-zamora Carlos Zamora (carlos-zamora) left a comment •

Copy link
Copy Markdown

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)

Comment thread src/cascadia/TerminalApp/Pane.cpp Resolved
Comment thread src/cascadia/TerminalApp/Pane.cpp Resolved
@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 (carlos-zamora) removed the Needs-Discussion Something that requires a team discussion before we can proceed label Jul 25, 2022
@PankajBhojwani

Copy link
Copy Markdown
Contributor Author

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

@DHowett

Copy link
Copy Markdown
Member

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

@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.

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

@zadjii-msft Mike Griese (zadjii-msft) added the AutoMerge Marked for automatic merge by the bot when requirements are met label Aug 1, 2022
@ghost

Copy link
Copy Markdown

Hello Mike Griese (@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
Copy Markdown
Member

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
Copy Markdown
Member

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
Dustin L. Howett (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
Dustin L. Howett (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
Copy Markdown

🎉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