Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I connect to a headless Ubuntu server (no X) over SSH and run Emacs. In my ~/.emacs file I have defined a keyboard shortcut using the 's' (Super) modifier. This shortcut works when I run Emacs in a GUI but does not work over SSH. I have searched for an explanation but have not found one yet. I assume that the Super key is not passed over the SSH link?

share|improve this question
    
don't know really, haven't used either much, but are you logging into the ssh server as the same user? i.e. when you use ubuntu is your username there when the superkey works, the same as the one you use when you ssh to the ssh server when the superkey doesn't work? If you try the pwd command in cd ~/, does it show the same home directory –  barlop Apr 1 '12 at 20:46
    
Not sure I follow what you're saying. I login as ABC on the GUI machine where ~/.emacs has a Super-key shortcut defined. I sometimes login via SSH into a headless machine as user XYZ where the same .emacs file is in ~, so the Super-key definition exists on both machines, but only works on the GUI machine. –  SabreWolfy Apr 2 '12 at 19:47

2 Answers 2

up vote 3 down vote accepted

The GUI version of Emacs can listen for any keypress using the X11 protocol. The terminal version is a bit more limited – it can only receive keypresses the terminal program forwards; modifier keys only work as modifiers, never as separate keys; finally, the Super key is just not forwarded by any emulator, simply because it is generally thought to be reserved to the OS for such things as window management.

share|improve this answer

If you really need to use the less standard modifier keys from a terminal emulator, emacs has keybindings for these:

C-x @ S         event-apply-shift-modifier
C-x @ a         event-apply-alt-modifier
C-x @ c         event-apply-control-modifier
C-x @ h         event-apply-hyper-modifier
C-x @ m         event-apply-meta-modifier
C-x @ s         event-apply-super-modifier

So in your case, use C-x @ s for the super modifier.

share|improve this answer
    
Awesome, thanks. That's very useful to know. Tested it now and it even works through PuTTY. (I wish I could accept your answer too, but grawity's answer specifically addressed my question, so I've accepted that answer.) –  SabreWolfy Apr 2 '12 at 19:51

Your Answer

 
discard

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.