From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tyler Smith Newsgroups: gmane.emacs.help Subject: Re: arrow keys in the console Date: 19 May 2007 03:14:18 GMT Organization: Sedgeboy Inc. Message-ID: References: <87646qoaow.fsf@thalassa.lan.informatimago.com> <873b1tfrb0.fsf@lion.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1179546150 10168 80.91.229.12 (19 May 2007 03:42:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 19 May 2007 03:42:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 19 05:42:29 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HpFpt-0003i6-H4 for geh-help-gnu-emacs@m.gmane.org; Sat, 19 May 2007 05:42:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HpFpt-0002ch-28 for geh-help-gnu-emacs@m.gmane.org; Fri, 18 May 2007 23:42:29 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news4.google.com!out01a.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!nx01.iad01.newshosting.com!newshosting.com!post02.iad01!post01.iad01!news.aliant.net!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: slrn/0.9.8.1pl1 (Debian) Original-Lines: 63 Original-X-Complaints-To: abuse@aliant.net Original-Xref: shelby.stanford.edu gnu.emacs.help:148572 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:44164 Archived-At: On 2007-05-19, Tim X wrote: > Tyler Smith 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 > Thanks for the detailed explanation. I've tried working through dumpkeys and loadkeys. It's a bit dense for me, but I'll keep at it. In the meantime I'll probably spend most of my time in emacs under X, where I get predictable behaviour from my keyboard. Cheers, Tyler