0

(Emacs 27.1)

On my local machine <C-tab> is linked to other-window and works well:

.emacs.d/init.el:

(global-set-key (kbd "<C-tab>") 'other-window)

When I install Emacs on a (Debian10-based) server, the same configuration fails. I access Emacs through (LXTerminal) ssh. <C-tab> does nothing (but calling M-x other-window works, as well as C-x o, the default shortcut) : no error message, no warning. When starting Emacs, no warning message appears in the *Messages* buffer.

On my server and on my local machine, C-h k TAB returns:

TAB runs the command indent-for-tab-command (found in global-map),   
which is an interactive compiled Lisp function in ‘indent.el’.
It is bound to TAB.
(indent-for-tab-command &optional ARG) [...]

On my local machine, C-h k <C-tab> returns:

<C-tab> runs the command other-window (found in global-map), which is an interactive compiled Lisp function in ‘window.el’.

It is bound to <C-tab>, C-x o.

(other-window COUNT &optional ALL-FRAMES) [...]

On my server, C-h k <C-tab> returns:

TAB runs the command indent-for-tab-command (found in global-map),
which is an interactive compiled Lisp function in ‘indent.el’.
It is bound to TAB.   
(indent-for-tab-command &optional ARG)
[...]

See a similar problem with iTerm here and a related post here.


This is the way I compile Emacs:

sudo apt install -y build-essential git apt build-dep -y emacs25 git
clone --depth 1 --branch emacs-27
https://git.savannah.gnu.org/git/emacs.git 
cd emacs 
./autogen.sh
./configure make make install cd ..
 
emacs --version
7
  • 1
    It sounds like your platform (something about it) is not passing Control + TAB to Emacs.
    – Drew
    Dec 21 '20 at 16:13
  • @Drew : Yes, you're surely right. By the way, ssh through LXTerminal 0.3.2 (I can't edit my message anymore)
    – suizokukan
    Dec 21 '20 at 17:21
  • Are you sure you can't edit it. That sounds weird.
    – Drew
    Dec 21 '20 at 22:00
  • 1
    Does this answer your question? How can I use Emacs and iTerm for the same keybinding?
    – Drew
    Dec 21 '20 at 22:57
  • 1
    Here's another that this might be a duplicate of: emacs.stackexchange.com/a/1056/105
    – Drew
    Dec 21 '20 at 23:04
2

That's correct. Any time you run Emacs inside a terminal, whether ssh is involved or not, you lose the ability to type a control-tab. There is simply no way for the terminal emulator to encode that control-tab was pressed, so all it can send is the tab. Some terminal emulators can be configured to send additional escape sequences for some keys, and you can then add keybindings to Emacs for those escape sequences. Otherwise there are only the 32 ASCII control characters available. That gives you control plus A through Z and the punctuation characters @[]^_.

I would recommend running the Emacs GUI locally and then using TRAMP to access files over ssh. https://www.gnu.org/software/tramp/#Using-ssh-and-plink

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.