all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bob Proulx <bob@proulx.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Which key combos are not possible in remote Emacs session because terminal interferes?
Date: Sat, 7 Feb 2015 19:16:25 -0700	[thread overview]
Message-ID: <20150207182704268672544@bob.proulx.com> (raw)
In-Reply-To: <bba4429f-cce4-489a-bccf-e09499a01949@googlegroups.com>

Chris Seberino wrote:
> When using Emacs on a remote server by SSH-ing, not all key combos
> can be used as shortcuts like locally.

What key combinations are you wanting to use that are not available?

When using a local graphical interface every key press and release is
individually available for use.  Therefore any combination is
possible.

When operating over an ssh connection your terminal emulator is the
graphical interface.  Your terminal emulator reads your keys and sends
characters down the 8-bit serial interface over the network to the
remote emacs.  The remote emacs will operate as if it were on a serial
terminal using the terminfo/termcap specifications for $TERM and the
associated terminal database of terminal display capabilities.

The standard ASCII characters are self-explaining (and self-inserting,
haha) but only a small set.  Control characters are the character with
the 7th bit cleared, same as subtracting 0x40 hex from it.  For
example character 'H' is 0x48 hex.  Control-H is 0x8 hex.  Which
explains why Control-G is 0x7 the bell character.  The bell interrupts
something and rings the bell and so does Control-G in emacs.  Control
characters are fairly consistently implemented up through C-z but are
inconsistently implemented for the last few {, |, }, ~, DEL.  Those
control combinations tend not to work depending upon the emulator.

At one time the meta key set the "high" bit.  ASCII is a 7-bit
encoding leaving the 8th bit available to be set.  This now conflicts
with use of UTF-8 unicode and AFAIK this is no longer used anywhere by
anyone who cares about UTF-8 due to this.  I do not miss it.

Most terminals now encode the meta key as an escape sequence sending
the ESC character followed by the desired character.  M-w for example
(holding down Alt on a US-PC keyboard and pressing w) will be encoded
as an ESC w two character sequence.  This often needs explicit
configuration.  XTerm for example needs this resource set explicitly
or it will instend send the 8-bit value yielding different results.

  XTerm*metaSendsEscape:true

Some people undoubtedly like the 8-bit Alt key behavior.  For example
it allows typing in many glyphs using the Alt key instead of the
Compose or AltGr keys using the international input methods.  It is a
personal preference but I prefer to have a working meta key for emacs
and I can enter the non-ascii characters using the Compose key.

Without a working meta key they would send all M- sequences by sending
ESC explicitly first.  ESC w is the same to emacs as M-w.  Any C-M-
something or M-C- something sequences will be ESC followed by the C-
something character.  For example C-M-r would be ESC C-r.

Also C-[ is the same as ESC.  A quick touch typist learns C-[ as way
to enter ESC without removing fingers from the home row.  C-[ w is the
same as C-w for example.  C-[ C-r would be the same as ESC C-r and the
same as C-M-r.

Some terminal emulators also interface with the mouse.  An abomination
as I am sure you realize but some terminal emulators will encode mouse
activity into the serial data stream.  This is again terminal emulator
dependent depending upon many things.

Hopefully the above gives some explanation and insight into working
with emacs.  Understanding that should explain why any particular key
combination is possible or not over an ssh connection.  The biggest
lever is not ssh but the terminal emulator you are using at the time.
Different terminal emulators have different capabilities and
limitations.

> Which key combos are not possible in remote Emacs session because
> terminal interferes?
> 
> Is there a table or list somewhere?

Every terminal emulator is different.  A similar question would be
could we generate a list of colors that are used by artists when they
paint.  It is similarly open-ended.

Bob



  parent reply	other threads:[~2015-02-08  2:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-07  7:48 Which key combos are not possible in remote Emacs session because terminal interferes? Chris Seberino
2015-02-07  8:15 ` Eli Zaretskii
2015-02-08  2:16 ` Bob Proulx [this message]
2015-02-08 18:04   ` Philipp Stephani
     [not found] ` <mailman.19501.1423361792.1147.help-gnu-emacs@gnu.org>
2015-02-09  2:20   ` Hikaru Ichijyo
2015-02-09  4:12   ` Chris Seberino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150207182704268672544@bob.proulx.com \
    --to=bob@proulx.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.