jupyterlab-desktop icon indicating copy to clipboard operation
jupyterlab-desktop copied to clipboard

Disable ctrl+w closing the entire app

Open scholer opened this issue 2 years ago • 6 comments

Hi,

Thanks for making an excellent piece of software, I'm really enjoying both Jupyterlab desktop and the browser app. I know these are still early days for the Desktop app, so don't take this as a hard critique or anything like that, I just would like to eliminate one of the few frustrations I'm having with the Jupyterlap app.

How do I prevent ctrl+w from closing the entire JupyterLab desktop app?

The expected behavior from any other app is: ctrl + w will close open tabs or documents. In this case, close the currently-selected notebook. While Alt+F4 will close the entire app. Jupyterlab does not conform to this UI norm, so I would like to fix that. What is the best way to go about that?

I checked the "Keyboard shortcuts" in the Settings, but I only saw "Close tab", which was assigned to Alt+w. Nothing about closing the entire app.

On a related note, how do I completely remove a shortcut? For instance, I would like to remove "Ctrl+P" shortcut for printing. But it doesn't seem possible? I can select the keyboard shortcut field, and I could type in another keyboard shortcut, but I can't remove the keyboard shortcut.

Note: Unlike with the browser app, closing the Jupyterlab desktop app accidentally is really annoying. In the browser app, I can just "ctrl+shift+t" to re-open the jupyter app, and have it back up in a few seconds. With the app, because it has to start the server, it takes much longer to re-open the app. So I would like to make it much harder to accidentally close the app.

One more thing, while we are at it: The symbols for Ctrl/Alt/Cmd are misaligned, making them hard to read. Personally, I would prefer to just have "Ctrl", "Alt", "Shift", "Cmd", instead of symbols, as I can never remember which symbol is which (except for CMD). So instead of reading "Alt+w", I'm reading "<some symbol I don't know>+w" - then referring to the symbols list to figure out what the actual shortcut is.

scholer avatar Mar 29 '22 11:03 scholer

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

welcome[bot] avatar Mar 29 '22 11:03 welcome[bot]

There are multiple issues in this report. Going through them in order:

How can I disable CTRL+W closing the entire app?

Is it possible to change the shortcut for "close notebook" from ALT+W to CTRL+W? What happens when you do this?

How can I disable a shortcut?

The JupyterLab shortcut editor https://github.com/jupyterlab/jupyterlab/issues/7597 doesn't have an option in the UI to disable a shortcut. In addition, the documentation for editing shortcuts in JupyterLab is out of date: https://github.com/jupyterlab/jupyterlab/issues/7570

@marthacryan added an enhancement request in JupyterLab to provide the option to disable shortcut keys in the new settings editor: https://github.com/jupyterlab/jupyterlab/issues/12316

Symbols misaligned for shortcut keys

See https://github.com/jupyterlab/jupyterlab/issues/11988 for more on this issue.

JasonWeill avatar Mar 31 '22 17:03 JasonWeill

Another issue related to this: if you do close the JupyterLab window, either with control-W or closing the window, some JupyterLab processes don't get killed.

  1. Before launching any JupyterLab desktop, I see 0 processes matching "jupyterlab-desktop" or "jlab" in ps.
  2. While one is running, there are a lot of such processes (8 on my computer).
  3. After closing it with "shut down" from the "file" menu, there are 0 processes.
  4. After launching another and closing it by closing the window, there are 3 processes.
  5. I do that again and get another 3, for a total of 6 processes.
  6. If I do "shut down" again, it does not add to the number of processes. Only if I close the window without shutting down.

The 3 processes look like this, all under my user account:

/opt/JupyterLab/jupyterlab-desktop --type=zygote --no-zygote-sandbox
/opt/JupyterLab/jupyterlab-desktop --type=zygote
/opt/JupyterLab/jupyterlab-desktop --type=zygote

So, more than just being an inconvenience of unintended behavior, it leaves a residue.

(If this needs to be another issue, I'll move it to one.)

jpivarski avatar May 11 '22 17:05 jpivarski

Just for clarity, which OS are you running jupyterlab-desktop on?

JasonWeill avatar May 12 '22 17:05 JasonWeill

This is on Ubuntu 22.04... actually Pop_OS 22.04 (but I don't think there's much difference).

% uname -a
Linux hilbert-space 5.17.5-76051705-generic #202204271406~1651504840~22.04~63e51bd SMP PREEMPT Mon May 2 15: x86_64 x86_64 x86_64 GNU/Linux

% lsb_release -a
No LSB modules are available.
Distributor ID:	Pop
Description:	Pop!_OS 22.04 LTS
Release:	22.04
Codename:	jammy

I installed it through the .deb (JupyterLab-Setup-Debian.deb), which came from this link yesterday (May 11, 2022): https://github.com/jupyterlab/jupyterlab-desktop/releases/latest/download/JupyterLab-Setup-Debian.deb

This computer did not previously have JupyterLab-Desktop installed, though my base conda environment (only channel: conda-forge) does have the JupyterLab package installed. When JupyterLab-Desktop first came up, it prompted me for a Python executable corresponding to an environment with a new-enough JupyterLab, and I pointed it at my base conda environment so that I'd have only one environment (which I always keep up to date, and its JupyterLab is easily new-enough).

I think that describes my entire set-up.

jpivarski avatar May 12 '22 19:05 jpivarski

+1 on this, I would like to be able to customize / disable this ctrl w behavior, as I am using "a la vim bindings" (ie ctrl w i/j/k/l) to move between my tabs...

jerabaul29 avatar Oct 10 '22 13:10 jerabaul29

For a long time, I have been using one browser (Safari) for JupyterLab and another (Chrome) for everything else on my Mac. But I have persistent annoyances with Safari, including accidentally closing the JupyterLab window.

So I thought to myself, wouldn't it be a good idea to make an Electron desktop app for JupyterLab? And lo and behold, I found that it already exists. Great job! I love this app. Except for one thing.

I keep hitting command-W instead of option-W when I want to close a tab within JupyterLab. This closes the whole window and everything needs to be restarted from scratch. This is really annoying, and it is one of the things I was hoping would be an improvement over Safari. But it's worse than Safari, since the kernels are killed as well as the browser tabs.

Would it be possible to provide an option to disable this keybinding? I also think the app should ask the user to confirm before doing something so drastic.

pjheslin avatar Feb 16 '23 12:02 pjheslin

@mbektas

Thanks a lot for the update! I've been really looking forward to the fix. Can I ask a really simple question? I'm following https://github.com/jupyterlab/jupyterlab-desktop/pull/606 but I can't find the setting in my JupyterLab-Desktop. I'm using Version 3.6.2-1 (3.6.2-1). See below for screenshots of my "Advanced Settings Editor" under "Settings".

Screen Shot 2023-03-31 at 1 04 27 PM

I searched for "Bahavior" in settings but couldn't find it either. Screen Shot 2023-03-31 at 1 06 08 PM

Could you please let me know where to find the setting for this?

seapanda85 avatar Mar 31 '23 20:03 seapanda85

Thanks a million for adding this feature -- it works perfectly.

pjheslin avatar Apr 01 '23 19:04 pjheslin

@mbektas

Thanks a lot for the update! I've been really looking forward to the fix. Can I ask a really simple question? I'm following #606 but I can't find the setting in my JupyterLab-Desktop. I'm using Version 3.6.2-1 (3.6.2-1). See below for screenshots of my "Advanced Settings Editor" under "Settings".

Screen Shot 2023-03-31 at 1 04 27 PM

I searched for "Bahavior" in settings but couldn't find it either. Screen Shot 2023-03-31 at 1 06 08 PM

Could you please let me know where to find the setting for this?

Never mind. Finally found it!

seapanda85 avatar Apr 02 '23 06:04 seapanda85