Currently, the Remove Block keyboard shortcut is Ctrl+Alt+Backspace. This works fine on Windows and macOS. But on Linux, if you are using the X Window System or Weston (the reference Wayland implementation), this keyboard shortcut will cause the display server to shut down or restart. Obviously, this is quite a surprise to anyone who is just trying to delete a block, and can certainly cause some unexpected data loss.
Tested on Antergos Linux using X11 and KDE Plasma.
I searched for documentation about keyboard shortcuts for Linux to see if I could find a good reference for Ctrl+Alt+Backspace
and the closest I could find is Ctrl+Alt+Delete
is for logging out in KDE/GNOME (ref) and on some Linux-based operating systems including Ubuntu and Debian (ref) and, on Ubuntu Server, it is used to reboot a computer without logging in.
@designsimply
https://utcc.utoronto.ca/~cks/space/blog/unix/XBackspaceTerminateHistory
https://www.howtogeek.com/howto/linux/disable-ctrlaltbackspace-from-restarting-x-windows-on-linux/
It is also mentioned in this table:
https://en.wikipedia.org/wiki/Control-Alt-Delete#Equivalents_on_various_platforms
It looks like the shortcut is disabled by default in some distros like Ubuntu. Apparently it is not in Antergos (and presumably also Arch Linux).
This is a pretty serious issue. ctrl-alt-backspace or ctrl-alt-del is a common shortcut to restart the xorg server. (Not gracefully logging out, but killing all applications running within the x session, similar to killing the Login Window process in MacOS.)
However, I suggest removing the accessibility tag from this issue.
This should only affect backspace, not delete. Delete was avoided because of the obvious Windows shortcut Ctrl+Alt+Del
.
It's very very easy to change the shortcut, but very very hard to find combinations that work and don't conflict with something.
Would be good to have some suggestions of shortcuts that might work. I think just about every combination involving backspace/delete/d has been ruled out now.
Could we use the minus key instead of the Delete key? Ctrl + Shift + Minus?
@jasmussen That does not seem to already be in use for anything on Antergos Linux using Firefox, so I think we could! :+1:
โ๏ธ Made a PR to change it to Ctrl+Shift+-
Seems to work in my testing on Windows & Mac. Would be great if someone could test on Linux.
The only thing that looks a bit odd is the way the shortcut is displayed in the block settings menu (screenshot in the PR description). I think it's ok though, if tackled, we should do it on a separate issue.
This is an interesting issue to bring forward. Indeed, Ctrl+Alt+Backspace
is not ideal in Linux. There are ways around this, including remapping the shortcut only for Linux or for all platforms, but I just wanted to leave a drive-by thought:
Perhaps a root problem is that our primaryAlt
modifier maps to Cmd+Opt
in macOS and Ctrl+Alt
elsewhere. I'd argue, though this is subjective, that โ while Cmd+Opt
is a common prefix for many application-level hotkeys in macOS tradition โ Ctrl+Alt
feel idiomatically more "serious", not uncommonly dealing with system-level interactions.
It's very very easy to change the shortcut, but very very hard to find combinations that work and don't conflict with something.
It is indeed. I'd say it's a known issue since years and years, especially to people who specialize in keyboard accessibility. Operating systems, browsers, extensions, keyboard layouts, not to mention assistive technologies, etc. bring in a huge amount of keyboard shortcuts and it's basically impossible to guarantee there won't be conflicts. As I see it, the only solution in the long term would be considering a mechanism to allow users to remap shortcuts, as proposed in https://github.com/WordPress/gutenberg/issues/3218 (now moved to projects > ideas). I'd agree that's something to consider for a future version.
@afercia I have some ideas on how that could be achieved. It basically consists of moving the definition of shortcut keys into a very simple redux store. It sort of kills two birds with one stone - a central place to define keyboard shortcuts (at the moment they're all over the codebase) and also allowing the future possibility of remapping keys.
Also, potentially we could define different defaults that could be switched betwen (ie. for different keyboard layouts)
a central place to define keyboard shortcuts (at the moment they're all over the codebase)
@talldan that would be awesome ๐(also for maintenance, handbook documentation)
Reopening since #9190 has been reverted.
Have opened a new pull request to address this - #10008
Would be great to get some testing, especially on linux. ๐
Hi @talldan. I just got this unpleasant surprise today for the first time, as I was exploring upgrading my Gutenberg keyboard skills.
Hi @lkraav - the fix should be in 4.0.0. Sorry for stopping your display server ๐ญ
Most helpful comment
Have opened a new pull request to address this - #10008
Would be great to get some testing, especially on linux. ๐