I am connecting from a Mac (with OSX 10.6) to a Linux machine (with CentOS 6.6) by using the ssh command (ssh -X). On the Mac side, I am using the Terminal app. After logging into Linux, I can use Emacs (emacs -nw) or vim for my programming without problem, but all the other applications like Emacs (window mode), Firefox, visualization software, etc, do not recognize my keyboard input correctly. For example, if I enter


on the Mac side, Linux applications show the characters as


The same thing happens for GUI admin tools like system-config-users. These Linux applications use X11, and the Mac uses XQuartz 2.3.6, but I am not sure whether the problem is due to X. Setting an environment variable like LANG=C gedit did not work either. Do you have any ideas why this happens?

  • 1
    Maybe X can't recognize your keyboard correctly, so I guess you'd need to re-map it using xmodmap or xkb. – McSinyx Jul 19 '15 at 13:44
  • @McSinyx Thanks, I'll try it tomorrow :) Because of this problem it is very incovenient to use any GUI... – roygvib Jul 19 '15 at 14:33
  • 1
    Do OSX X11 applications work correctly? The machine on which the application was launched shouldn't matter. Run the OSX xev command and press A in the xev window, what KeyPress is recorded? Do the same with the xev command from the remote machine over ssh. – Gilles Jul 19 '15 at 21:36
  • @Gilles Because I couldn't find xev on OSX (but found later), I first tested xev on the Linux side over ssh. Then, KeyPress returned "A" when I typed "a", and so on. After that, I noticed that there is some setting menu for OSX X11 like "Follow the system keyboard layout", and so I tried turning this switch on and restarted OSX X11. Then xev (started from Linux) now recognized my input correctly!! Also, gedit and visualization programs etc all worked well. So the problem seems this setting on OSX X11... Thank you very much :D – roygvib Jul 20 '15 at 8:16

Your Answer

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

Browse other questions tagged or ask your own question.