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

Remove Block keyboard shortcut causes display server on Linux to shut down or reboot #9036

Closed
ZebulanStanphill opened this issue Aug 15, 2018 · 15 comments · Fixed by #9190 or #10008
Closed
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Bug An existing feature does not function as intended

Comments

@ZebulanStanphill
Copy link
Member

The issue

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.

@ZebulanStanphill ZebulanStanphill changed the title Change Remove Block keyboard shortcut due to conflicts with X11 and Wayland server exit shortcut Remove Block keyboard shortcut due causes X11 and Wayland server to shut down or reboot Aug 15, 2018
@ZebulanStanphill ZebulanStanphill changed the title Remove Block keyboard shortcut due causes X11 and Wayland server to shut down or reboot Remove Block keyboard shortcut due causes display server on Linux to shut down or reboot Aug 15, 2018
@designsimply
Copy link
Member

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 designsimply added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). labels Aug 15, 2018
@ZebulanStanphill
Copy link
Member Author

@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).

@aldavigdis
Copy link
Contributor

aldavigdis commented Aug 20, 2018

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.

@talldan
Copy link
Contributor

talldan commented Aug 20, 2018

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.

@jasmussen
Copy link
Contributor

Could we use the minus key instead of the Delete key? Ctrl + Shift + Minus?

@ZebulanStanphill
Copy link
Member Author

@jasmussen That does not seem to already be in use for anything on Antergos Linux using Firefox, so I think we could! 👍

@ZebulanStanphill ZebulanStanphill changed the title Remove Block keyboard shortcut due causes display server on Linux to shut down or reboot Remove Block keyboard shortcut causes display server on Linux to shut down or reboot Aug 20, 2018
@talldan talldan self-assigned this Aug 21, 2018
@talldan
Copy link
Contributor

talldan commented Aug 21, 2018

☝️ 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.

@mcsf
Copy link
Contributor

mcsf commented Aug 21, 2018

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.

@afercia
Copy link
Contributor

afercia commented Aug 23, 2018

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 #3218 (now moved to projects > ideas). I'd agree that's something to consider for a future version.

@talldan
Copy link
Contributor

talldan commented Aug 23, 2018

@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)

@afercia
Copy link
Contributor

afercia commented Aug 23, 2018

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)

@talldan talldan reopened this Aug 28, 2018
@talldan
Copy link
Contributor

talldan commented Aug 28, 2018

Reopening since #9190 has been reverted.

@talldan
Copy link
Contributor

talldan commented Sep 18, 2018

Have opened a new pull request to address this - #10008

Would be great to get some testing, especially on linux. 😄

@lkraav
Copy link

lkraav commented Oct 8, 2018

Hi @talldan. I just got this unpleasant surprise today for the first time, as I was exploring upgrading my Gutenberg keyboard skills.

#10008 seems to have been merged, but I'm on 3.9.0 and X still got killed. Gutenblock context menu still says "Remove block Ctrl+Alt+Backspace". I'm I supposed to see or experience something different?

@talldan
Copy link
Contributor

talldan commented Oct 10, 2018

Hi @lkraav - the fix should be in 4.0.0. Sorry for stopping your display server 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Bug An existing feature does not function as intended
Projects
None yet
8 participants