I suffered from the same until I discovered Gnome tweaks' "Emacs input" setting, which makes every text field behave like a Bash readline prompt with emacs keybindings!
You can use Ctrl/Cmd + Shift + T to re-open the last closed tab (assuming your actual changes are saved elsewhere; I haven't really used Jupyter)
Re:Web-based editor
by ajyotirmay on Sunday September 05, 2021 @07:40AM
(#28423523)
Firefox has a config option to not close window with lasttab. I actually find it quite useful. If you're on Chromium based browser, pretty sure there will be something similar
This kills me with Jupyter. Open bash kernel, make typo, Ctrl+w, sigh as tab disappears. I often open and pin several empty tabs so it only kills the tab, not the whole window.