I just find this behavior interesting (I can fix it by rebooting). What can cause it and is there any way to switch it off within the session? Or am I free to conclude it's only a bug?

This may help: pressing the Fn keys acts as if the alt key is pressed (switches between consoles). Using the alt key doesn't have the toggle fixing effect.

Restarting agetty doesn't help. All consoles behave this way and none of them happen to be logged in so I can't confirm this behavior in the interactive shell nor will I be able to use the shell for some of the proposed solutions, apparently.

  • Can you clarify what you mean by non-GUI console - do you mean the things you get normally by typing ctrl-alt-f3 for example? Do you have working xterm available on the GUI? – icarus Jan 3 '17 at 12:23
  • @icarus Yes, the (ctrl+)alt+Fn consoles. By the way, since it seems even non-GUI console is ambiguous, what on earth should we call them? Any idea? – argle Jan 3 '17 at 12:32
  • en.wikipedia.org/wiki/Virtual_console - Do you have working terminal windows on the gui? Can you ssh into the machine from another machine? – icarus Jan 3 '17 at 12:38
  • 1
    I just answered that very question at unix.stackexchange.com/a/333922/5132 – JdeBP Jan 3 '17 at 17:53
  • @icarus Yes, working GUI terminals. Actually everything else is normal. It's just the kernel consoles that are misbehaving. (And yes, I can ssh into it). – argle Jan 3 '17 at 19:58

You may have a bod keyboard, or it could be just one of those things. Firstly what is working normally: the keyboard layout you are using has something like meta sends escape and has mapped a meta key. It could also be alt sends escape, but I don't think so. What is meta? It is the fourth shift state (the first three are shift control and alt). The most common choice for a meta key is either one of your alt keys or the windows key. Now what went wrong? You lost a key release event. The way keyboards work is for every letter typed you get two events: a key press and a key release (there is also a key repeat that you get when you hold a some keys but not shift keys). Capital letters needing a shift state have four events, for example a capital A would be shift press, a press, a release, and shift release. Similarly for control alt and meta shift states are entered on key press and left on the corresponding release. So with the symptoms you were seeing you probably lost a key meta release. This could be electrical noise, a bad keyboard (if it happens frequently and could just be a sticky key) or a software bug. If it is a software bug it is oft caused by context switches between multiple parsers of key events with inconsistent use of shifts during context switches. For example, if your window manager uses alt tab to switch windows and you use it to switch either to or away from vnc and use the mouse to go the other way your alt shift state may become confused on the remote machine, or in this case if you used meta-alt-f7 to switch to X and ctl-alt-f1 to switch back, the text console would have seen an extra control release which it ignored, but not seen the meta release. or your meta key is stuck.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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