-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Enable Terminal closing with ALT + F4 and warning of multiple open tabs #2526
Enable Terminal closing with ALT + F4 and warning of multiple open tabs #2526
Conversation
I like this. We should file a followup workitem for the following additional work:
|
Seems that ContentDialog does not have this by default. We could customize ContentDialog, but in this way we will lose the built-in title/text/buttons and will have to provide those by ourselves. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple small changes suggested. Otherwise looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work with both light and dark mode? Are the buttons visible even when the app's theme is opposite the system theme? This probably won't update if you change the theme while the dialog is open, but I don't think any of ours do ATM.
Overall this seems like a fine starting point to me. I'd love to have a lot more customization around this in the future, but this is a good enough start. I still have a couple questions so I'm not going to sign off quite yet.
In "dark" theme, the content dialog will change to "dark" but the buttons remain the same: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before you merge this, please change the title.
Pretend that you are completing the sentence, "This commit will..."
Remember: pull request titles and commit titles are supposed to read like e-mail subject lines. They should be concise, imperative, and convey enough useful information so that somebody looking at history will be able to understand them.
They are permanent.
Title changed. Will pay attention to the PR and commit titles in the future. |
Thanks! |
🎉 Handy links: |
Hi, please add warning for clicking 'close' on the upper right too~ Thanks~ |
Summary of the Pull Request
This PR is for: #1589
We add a key binding called "CloseWindow", which will close the whole terminal, and warn the user if multiple tabs are opened. The user could choose to cancel or continue the closing action.
References
PR Checklist
Detailed Description of the Pull Request / Additional comments
In my Page-App refactoring change: #2208, _showDialog's signature is changed. I only pass a ContentDialog to it and the contents are constructed in each specific dialog initialization methods. In this PR, I follow this pattern.
Testing:
{
"command": "closeWindow",
"keys": [
"alt+f4"
]
}
to the end of the "keybindings" list.