-
Notifications
You must be signed in to change notification settings - Fork 6k
prevent ctrl+w from closing tab #53
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
Comments
Will definitely add this! |
Can you use Ctrl + W to close editor tabs or some other VSCode functions? |
Hotkey should be consistent with |
Important to have a page in the documentation listing all the default code-server shortcuts |
Right now when I press |
we could use something like window.onbeforeunload = function (e) {
// Cancel the event
e.preventDefault();
// Chrome requires returnValue to be set
e.returnValue = 'Really want to quit the game?';
}; It doesn't prevent from closing, but at least show you an additional confirmation |
Fixed with #463. |
It totally closes the tab for me. Chrome: Version 80.0.3962.2 (Official Build) dev (64-bit) |
I didn't unassign anyone 🤔 |
@MicroDroid unfortunately we can't solve this - I believe this is also persistent in upstream VSCode so this is more of a by-design since you can't override Ctrl-W as far as I investigated. |
Perhaps we can at least show a confirmation dialog? |
I think we did that over in Theia, not sure how we want it on VSCode though. Feel free to bring this up to Microsoft as well. CC @code-asher what do you think? |
Hmm we used to do this but then it kept popping up when it wasn't needed like when using full-screen or an app window. If there's a way to distinguish between those states then we could put it back in. But maybe it'd be more proper for the change to be made upstream. |
The problem we ran into was that if you run something like this:
Then So we'd just need a way to detect if code-server is running in an app window (or full-screen because it should have the same behavior) and in that case elect not to prevent the window close. |
I guess it's not possible to catch the ctrl+w shortcut before the browser interprets it, but would it be possible to show a "leave this page?" confirmation dialog to prevent the good old muscle memory from screwing up ones work?
The text was updated successfully, but these errors were encountered: