Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had a really bad lockup of my X server and had to do a Sys Rq + r to release my keyboard from X and get into a console. I was able to kill the process that was locking up my system, and continue my work in my still running X server.

Now whenever I e.g. push Alt + F4 to kill a window, my system switches to the 4th console instead of killing the active window. So it seems that my keyboard still is in released mode.

How do I undo my previous Sys Rq + r command, such that I can continue my work in my running X server?

share|improve this question
up vote 16 down vote accepted

I found the solution myself just after asking this question.

To switch back the console in which X is running (usually tty7), from ASCII mode to RAW mode execute the following command:

sudo kbd_mode -s -C /dev/tty7

And now everything works as expected again. :)

More information available in the question: What does raw/unraw keyboard mode mean?

share|improve this answer
Thanks! Still trying to figure out if there's a way to do it for all ttys at once, the same way unRaw does... – phyzome Nov 1 '15 at 13:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.