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
suizokukan
  • 103
  • 4

1 Answers1

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

db48x
  • 15,741
  • 1
  • 19
  • 23