From: Tim X <timx@nospam.dev.null>
To: help-gnu-emacs@gnu.org
Subject: Re: arrow keys in the console
Date: Sat, 19 May 2007 13:03:31 +1000 [thread overview]
Message-ID: <873b1tfrb0.fsf@lion.rapttech.com.au> (raw)
In-Reply-To: mailman.807.1179498154.32220.help-gnu-emacs@gnu.org
Tyler Smith <tyler.smith@mail.mcgill.ca> writes:
> On Fri, May 18, 2007 at 04:00:30PM +0200, Peter Dyballa wrote:
>>
>> Am 18.05.2007 um 14:16 schrieb Tyler Smith:
>>
>> >echo $TERM now shows: linux. How do I find out what it should be?
>>
>> tset - -Q or such can determine the right value. It also would work
>> to set it xterm or xterm-color. This kind of terminal is supported by
>> GNU Emacs. Look into lisp/term directory!
>>
>
> Thanks! Setting TERM=xterm seems to have fixed it!
>
This is likely to cause you all sorts of 'weird' issues. In particular, it will
almost certainly screw up some terminal programs, which will now think they are
running under an X terminal with all that implies re: keycodes and modifiers,
mouse and cutting/pasting, colour mappings etc. Some programs will use the TERM
setting to work out what environment they are running under to determine what
features to load or make available. Having this set to xterm will confuse these
programs.
The correct solution is to load the right keymap. You can even setup a keymap
so that additional keys, like the 'windows' keys are mapped to something like
'super' or 'hyper', which gives you a whole new set of modifiers to take
advantage of. You can also redefine keys, such as swapping caps lock and
control, which some people like because its easier on the fingers etc.
Part of the reason that its a bad idea to just 'fool' the system by setting
TERM to xterm when running under the Linux text console is because normally, X
has a translation layer that affects the values seen by programs when a key is
pressed. The Linux console doesn't use the same scheme (mainly because it
pre-dates a lot of the 'extended' keyborad functionality and because much of
that functionality has no applicability in a text console). The extent to which
any of this has any impact depends on where/how the program is geting its
values. Any programs that use very low level functions to process keyboard
input are likely to behave weirdly with an incorrect TERM setting. Part of this
is because the TERM setting essentially points to a database that describes the
capabilities of the terminal your running under. While there is a lot of
similarity between the Linux console and an xterm, they are not the same - for
one thing, you cannot resize a Linux console. You are also likely to see
probems if you use ssh to connect to a remote server as this server will be
told that yo are running from an X term and will assume you have X capabilities etc.
In short, while it may appear to be working, its likely to have subtle
side-effects and is technically incorrect. The correct solution is to set the
correct keymap.
Tim
--
tcross (at) rapttech dot com dot au
next prev parent reply other threads:[~2007-05-19 3:03 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-18 1:00 arrow keys in the console Tyler Smith
2007-05-18 7:25 ` Pascal Bourguignon
2007-05-18 12:16 ` Tyler Smith
2007-05-18 12:37 ` poppyer
2007-05-18 14:00 ` Peter Dyballa
2007-05-18 15:14 ` Tyler Smith
[not found] ` <mailman.807.1179498154.32220.help-gnu-emacs@gnu.org>
2007-05-19 3:03 ` Tim X [this message]
2007-05-19 3:14 ` Tyler Smith
2007-05-19 4:54 ` Tim X
2007-05-19 2:38 ` Tim X
[not found] ` <mailman.805.1179497353.32220.help-gnu-emacs@gnu.org>
2007-05-19 2:41 ` Tim X
2007-05-19 3:00 ` Tyler Smith
2007-05-19 14:37 ` Peter Dyballa
[not found] ` <mailman.860.1179585463.32220.help-gnu-emacs@gnu.org>
2007-05-19 14:58 ` poppyer
2007-05-19 14:59 ` Tyler Smith
2007-05-19 17:22 ` Peter Dyballa
[not found] ` <mailman.872.1179595364.32220.help-gnu-emacs@gnu.org>
2007-05-20 15:43 ` Tyler Smith
2007-05-21 12:03 ` Will Parsons
2007-05-22 4:38 ` Xavier Maillard
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=873b1tfrb0.fsf@lion.rapttech.com.au \
--to=timx@nospam.dev.null \
--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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).