From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: arrow keys in the console Date: Sat, 19 May 2007 14:54:29 +1000 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <87ps4xe7lm.fsf@lion.rapttech.com.au> References: <87646qoaow.fsf@thalassa.lan.informatimago.com> <873b1tfrb0.fsf@lion.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1179553261 4350 80.91.229.12 (19 May 2007 05:41:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 19 May 2007 05:41:01 +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 07:40:59 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 1HpHgX-0008Bj-1g for geh-help-gnu-emacs@m.gmane.org; Sat, 19 May 2007 07:40:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HpHgT-00076O-Su for geh-help-gnu-emacs@m.gmane.org; Sat, 19 May 2007 01:40:53 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news3.google.com!out03b.usenetserver.com!news.usenetserver.com!in01.usenetserver.com!news.usenetserver.com!sn-xt-sjc-03!sn-xt-sjc-11!sn-xt-sjc-07!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.99 (gnu/linux) Cancel-Lock: sha1:xyqW7ddG3EBbezWo5IKxEW+0yk4= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 80 Original-Xref: shelby.stanford.edu gnu.emacs.help:148576 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:44168 Archived-At: Tyler Smith writes: > 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. > Many GNU Linux distros come with a selection of different keymaps you can load. For example, on Debian, these are in /usr/share/keymaps. In the /usr/share/keymaps/i386/qwerty directory, there are two keymaps which have emacs style bindings. these may or may not solve your problem, but even if they don't, a 'grep' of that directory for Up or Down will probably show you how to add this. There is also an 'include' directory that shows some more advanced things you can do. Once you see some examples, its not as complicated. Google is also very useful. Searching for Linux console keymaps and Linux Console arrow keys emacs brought up this link (together with many other potentially useful ones) http://www.linuxjournal.com/article/138 Tim -- tcross (at) rapttech dot com dot au