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

Please add some onbeforeunload handler in the workspace view to avoid unexpected tab exit #18416

Open
erikmd opened this issue Aug 2, 2023 · 10 comments

Comments

@erikmd
Copy link

erikmd commented Aug 2, 2023

Is your feature request related to a problem? Please describe

Currently using Gitpod in the browser is annoying when (like me) the Ctrl+w shortcut is wired in my hands, both in emacs and shell context…

Indeed, this closes the window.

Beyond my particular case, I believe many users also get annoyed when they mistype Ctrl+w and close their workspace tab.

Describe the behaviour you'd like

As suggested in #17724 (comment)

I would like to request some closing confirmation in all Gitpod browser editors,
→ with some JS code such as window.onbeforeunload = function(e) {e.preventDefault(); return false;}

and just undo this setting at workspace stop (e.g. gp stop, leading to page Stopped / Go-to-Dashboard)
→ with some JS code such as window.onbeforeunload = null;

Describe alternatives you've considered

One might otherwise try to disable the Ctrl+w shorcut in the browser, however as noted in
#17724 (comment)
this is neither browser-cross-compatible nor builtin in general, one needs to install 3rd-party extensions to do this.

So, adding an onbeforeunload handler looks way simpler, and fully works.

Additional context

N/A

@akosyakov
Copy link
Member

akosyakov commented Aug 2, 2023

VS Code already does it by default. If you want to have it always please change your settings "application.confirmExit": "always" otherwise it happens only for dirty changes.

@erikmd
Copy link
Author

erikmd commented Aug 2, 2023

Dear @akosyakov,

Sorry but I'm not a VS code user 😅

I only use Gitpod's Browser Terminal (currently in beta IIUC) as a Gitpod IDE.

Is this confirmExit option available as well for all Gitpod web editors (other than VS code)?

@erikmd
Copy link
Author

erikmd commented Aug 2, 2023

So I believe you could reopen this issue :)

@akosyakov
Copy link
Member

Sorry, yes makes sense, we should support something like that there.

@akosyakov akosyakov added the type: improvement Improves an existing feature or existing code label Aug 3, 2023
@erikmd
Copy link
Author

erikmd commented Aug 18, 2023

Dear @akosyakov, do you know:

  1. what could be the ETA for this improvement? (which will be important for Browser Terminal users IMHO)
  2. did you already set a date for ending the Beta/releasing the Browser Terminal editor?

Sorry if this is not the proper place to ask…

@erikmd
Copy link
Author

erikmd commented Sep 6, 2023

Dear Gitpod maintainers,

  1. did you already set a date for ending the Beta/releasing the Browser Terminal editor?

I guess you already replied to this one, thanks for the release 👍 ❗ 🙏

What about the second question?

  1. what could be the ETA for this improvement Please add some onbeforeunload handler in the workspace view to avoid unexpected tab exit #18416 ? (which will be important for Browser Terminal users IMHO)

Cc @loujaybee @akosyakov

Cheers,
Erik

@erikmd
Copy link
Author

erikmd commented Sep 6, 2023

Thanks @loujaybee for adding this label :)

— Actually I noticed the issue with emacs, so maybe it could be tagged editor: emacs as well?

Thanks for your time!

@erikmd
Copy link
Author

erikmd commented Mar 6, 2024

Dear @loujaybee,

Do you think this would help if I'd try to open a PR to implement this small (but very useful IMHO) enhancement?

Of course, I might need a bit of guidance at first, to spot the main components to change…

Copy link
Contributor

github-actions bot commented Jun 4, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the meta: stale This issue/PR is stale and will be closed soon label Jun 4, 2024
@erikmd
Copy link
Author

erikmd commented Jun 5, 2024

Hi! Please do not close, I do think this feature request is worth implementing.

@github-actions github-actions bot removed the meta: stale This issue/PR is stale and will be closed soon label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants