all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* arrow keys in the console
@ 2007-05-18  1:00 Tyler Smith
  2007-05-18  7:25 ` Pascal Bourguignon
  0 siblings, 1 reply; 19+ messages in thread
From: Tyler Smith @ 2007-05-18  1:00 UTC (permalink / raw)
  To: help-gnu-emacs

Hi, 

I'm having some issues with the arrow keys in the console, or when
running emacs -nw under X. If I use any of the arrow keys the cursor
moves up one paragraph and adds a letter to the screen. It's a
different letter for each key. I thought I might have something in X
or the console screwed up, but the arrows seem to work fine in mutt,
the command line, slrn etc. How do I fix this for emacs?

Here's the quoted output of up, down, right, left, pageup, and
pagedown, if that helps:

^[[A^[[B^[[C^[[D^[[5~^[[6~

Thanks,

Tyler

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
  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
  0 siblings, 1 reply; 19+ messages in thread
From: Pascal Bourguignon @ 2007-05-18  7:25 UTC (permalink / raw)
  To: help-gnu-emacs

Tyler Smith <tyler.smith@mail.mcgill.ca> writes:

> Hi, 
>
> I'm having some issues with the arrow keys in the console, or when
> running emacs -nw under X. If I use any of the arrow keys the cursor
> moves up one paragraph and adds a letter to the screen. It's a
> different letter for each key. I thought I might have something in X
> or the console screwed up, but the arrows seem to work fine in mutt,
> the command line, slrn etc. How do I fix this for emacs?
>
> Here's the quoted output of up, down, right, left, pageup, and
> pagedown, if that helps:
>
> ^[[A^[[B^[[C^[[D^[[5~^[[6~

You can fix it by setting the right value for the TERM environment variable.

What terminal emulator or what kind of console do you use?

For example, I use xterm, so I write:
TERM=xterm ; export TERM
in my ~/.bashrc file.


Otherwise, you can rebind the commands dynamically:
M-x global-set-key RET <up-arrow> RET previous-line RET
M-x global-set-key RET <down-arrow> RET next-line RET
M-x global-set-key RET <right-arrow> RET forward-char RET
M-x global-set-key RET <left-arrow> RET backward-char RET
etc...

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

NOTE: The most fundamental particles in this product are held
together by a "gluing" force about which little is currently known
and whose adhesive power can therefore not be permanently
guaranteed.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
  2007-05-18  7:25 ` Pascal Bourguignon
@ 2007-05-18 12:16   ` Tyler Smith
  2007-05-18 12:37     ` poppyer
                       ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Tyler Smith @ 2007-05-18 12:16 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-05-18, Pascal Bourguignon <pjb@informatimago.com> wrote:
>
> You can fix it by setting the right value for the TERM environment variable.
>
> What terminal emulator or what kind of console do you use?
>
> For example, I use xterm, so I write:
> TERM=xterm ; export TERM
> in my ~/.bashrc file.
>
I'm just experimenting with the console in linux, i.e., starting up
emacs without starting X. echo $TERM now shows: linux. How do I find
out what it should be?

For some reason the problem seems to have fixed itself in xterm when
running X. I've been mucking around in my .Xresources trying to fix
the xterm fonts, but I'm not sure what the change was that solved the
problem. It stil exists in the non-X console.

>
> Otherwise, you can rebind the commands dynamically:
> M-x global-set-key RET <up-arrow> RET previous-line RET
> M-x global-set-key RET <down-arrow> RET next-line RET
> M-x global-set-key RET <right-arrow> RET forward-char RET
> M-x global-set-key RET <left-arrow> RET backward-char RET
> etc...

I'll try that if I can't figure out the underlying problem, thanks.

Tyler

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
  2007-05-18 12:16   ` Tyler Smith
@ 2007-05-18 12:37     ` poppyer
  2007-05-18 14:00     ` Peter Dyballa
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 19+ messages in thread
From: poppyer @ 2007-05-18 12:37 UTC (permalink / raw)
  To: help-gnu-emacs

Hi, following is what I do to make my [home] [end] key works, I think arrow
keys can be done in a similar way.

put something like this in your .emacs file:
(define-key function-key-map "\eOH" [home])
(define-key function-key-map "\eOF" [end])
(define-key function-key-map "\e[7~" [home])
(define-key function-key-map "\e[8~" [end])

To get the strings right, you can test it in your terminal by ^V and the
key you want. 

Not sure if this is the right way, but at least it works :)


Tyler Smith <tyler.smith@mail.mcgill.ca> writes:

> On 2007-05-18, Pascal Bourguignon <pjb@informatimago.com> wrote:
> >
> > You can fix it by setting the right value for the TERM environment variable.
> >
> > What terminal emulator or what kind of console do you use?
> >
> > For example, I use xterm, so I write:
> > TERM=xterm ; export TERM
> > in my ~/.bashrc file.
> >
> I'm just experimenting with the console in linux, i.e., starting up
> emacs without starting X. echo $TERM now shows: linux. How do I find
> out what it should be?
> 
> For some reason the problem seems to have fixed itself in xterm when
> running X. I've been mucking around in my .Xresources trying to fix
> the xterm fonts, but I'm not sure what the change was that solved the
> problem. It stil exists in the non-X console.
> 
> >
> > Otherwise, you can rebind the commands dynamically:
> > M-x global-set-key RET <up-arrow> RET previous-line RET
> > M-x global-set-key RET <down-arrow> RET next-line RET
> > M-x global-set-key RET <right-arrow> RET forward-char RET
> > M-x global-set-key RET <left-arrow> RET backward-char RET
> > etc...
> 
> I'll try that if I can't figure out the underlying problem, thanks.
> 
> Tyler
> 
> 

-- 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
  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  2:38     ` Tim X
       [not found]     ` <mailman.805.1179497353.32220.help-gnu-emacs@gnu.org>
  3 siblings, 2 replies; 19+ messages in thread
From: Peter Dyballa @ 2007-05-18 14:00 UTC (permalink / raw)
  To: Tyler Smith; +Cc: help-gnu-emacs


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!

--
Greetings

   Pete

"If you don't find it in the index, look very carefully through the  
entire
  catalogue."          –  Sears, Roebuck, and Co., Consumer's Guide,  
1897

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
  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>
  1 sibling, 0 replies; 19+ messages in thread
From: Tyler Smith @ 2007-05-18 15:14 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

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!

Tyler



-- 
``I have no "intellectual property," and I think that all claimants to 
such property are thieves.''    --Wendell Berry

http://home.btconnect.com/tipiglen/resist.html

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
  2007-05-18 12:16   ` Tyler Smith
  2007-05-18 12:37     ` poppyer
  2007-05-18 14:00     ` Peter Dyballa
@ 2007-05-19  2:38     ` Tim X
       [not found]     ` <mailman.805.1179497353.32220.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 19+ messages in thread
From: Tim X @ 2007-05-19  2:38 UTC (permalink / raw)
  To: help-gnu-emacs

Tyler Smith <tyler.smith@mail.mcgill.ca> writes:

> On 2007-05-18, Pascal Bourguignon <pjb@informatimago.com> wrote:
>>
>> You can fix it by setting the right value for the TERM environment variable.
>>
>> What terminal emulator or what kind of console do you use?
>>
>> For example, I use xterm, so I write:
>> TERM=xterm ; export TERM
>> in my ~/.bashrc file.
>>
> I'm just experimenting with the console in linux, i.e., starting up
> emacs without starting X. echo $TERM now shows: linux. How do I find
> out what it should be?
>
> For some reason the problem seems to have fixed itself in xterm when
> running X. I've been mucking around in my .Xresources trying to fix
> the xterm fonts, but I'm not sure what the change was that solved the
> problem. It stil exists in the non-X console.
>
>>
>> Otherwise, you can rebind the commands dynamically:
>> M-x global-set-key RET <up-arrow> RET previous-line RET
>> M-x global-set-key RET <down-arrow> RET next-line RET
>> M-x global-set-key RET <right-arrow> RET forward-char RET
>> M-x global-set-key RET <left-arrow> RET backward-char RET
>> etc...
>
> I'll try that if I can't figure out the underlying problem, thanks.
>

Note that Pascal's advice is only relevant if your running under X. It will not
work under a linux console. 

I think your problem is to do with different keycodes/mappings between X and
the GNU Linux console. The console uses its own keymap and you need to use one
that will map the values from a console keyboard to something that emacs
recognises. Its a long time since I've looked at this, so my recollections are
a bit hazy. I suggest you look at the loadkeys man pages to start with. The
loadkeys program is used to manipulate the kernel keymap for the console. 

Many distributions have a package called something like console-data, which
contains various keymaps you can use. This would possibly give you some
examples (or maybe even a keymap already done that meets your needs). 

Tim


-- 
tcross (at) rapttech dot com dot au

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
       [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
  0 siblings, 1 reply; 19+ messages in thread
From: Tim X @ 2007-05-19  2:41 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> 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!
>
> --
NO! This will not work correctly for a GNU Linux console. The TERM setting of
'Linux', is *correct* for the console - do not change it. The problem is with
keymaps. Load the correct keymap and the problem is solved. 

Tim



--
tcross (at) rapttech dot com dot au

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
  2007-05-19  2:41       ` Tim X
@ 2007-05-19  3:00         ` Tyler Smith
  2007-05-19 14:37           ` Peter Dyballa
                             ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Tyler Smith @ 2007-05-19  3:00 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-05-19, Tim X <timx@nospam.dev.null> wrote:
> Peter Dyballa <Peter_Dyballa@Web.DE> writes:
>
>> 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!
>>
>> --
> NO! This will not work correctly for a GNU Linux console. The TERM
> setting of 'Linux', is *correct* for the console - do not change
> it. The problem is with keymaps. Load the correct keymap and the
> problem is solved.
>

Well, you're right. Setting TERM=xterm fixed the arrow keys, but
page-up and page-down still act funny. How do I load the correct
keymap?

Thanks,

Tyler

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
       [not found]       ` <mailman.807.1179498154.32220.help-gnu-emacs@gnu.org>
@ 2007-05-19  3:03         ` Tim X
  2007-05-19  3:14           ` Tyler Smith
  0 siblings, 1 reply; 19+ messages in thread
From: Tim X @ 2007-05-19  3:03 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
  2007-05-19  3:03         ` Tim X
@ 2007-05-19  3:14           ` Tyler Smith
  2007-05-19  4:54             ` Tim X
  0 siblings, 1 reply; 19+ messages in thread
From: Tyler Smith @ 2007-05-19  3:14 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-05-19, Tim X <timx@nospam.dev.null> wrote:
> 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
>

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
  2007-05-19  3:14           ` Tyler Smith
@ 2007-05-19  4:54             ` Tim X
  0 siblings, 0 replies; 19+ messages in thread
From: Tim X @ 2007-05-19  4:54 UTC (permalink / raw)
  To: help-gnu-emacs

Tyler Smith <tyler.smith@mail.mcgill.ca> writes:

> On 2007-05-19, Tim X <timx@nospam.dev.null> wrote:
>> 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
>>
>
> 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

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
  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-22  4:38           ` Xavier Maillard
  2 siblings, 0 replies; 19+ messages in thread
From: Peter Dyballa @ 2007-05-19 14:37 UTC (permalink / raw)
  To: Tyler Smith; +Cc: help-gnu-emacs


Am 19.05.2007 um 05:00 schrieb Tyler Smith:

>>> 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!
>>>
>>> --
>> NO! This will not work correctly for a GNU Linux console. The TERM
>> setting of 'Linux', is *correct* for the console - do not change
>> it. The problem is with keymaps. Load the correct keymap and the
>> problem is solved.
>>
>
> Well, you're right. Setting TERM=xterm fixed the arrow keys, but
> page-up and page-down still act funny.

Open ~/.emacs and then work on this loop:

	M-x global-set-key RET <press the key> RET <function binding> RET
	C-x Esc Esc C-a C-k C-g		; repeat last command, beginning, kill  
line, quit
	C-x b .emacs RET
	C-y

Finally save ~/.emacs.

The cursor movement functions are previous-line, next-line, backward- 
char, and forward-char.


Since there is a file /usr/local/share/emacs/22.1.50/lisp/term/ 
linux.el I wonder whether it's worth to write a bug report about the  
behaviour of your GNU Emacs in that "linux" terminal. It would be  
worth to mention the actual key bindings of your system!

--
Greetings

   Pete

When confronted with actual numbers, a mathematician is at a loss.
                                          (Steffen Hokland)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
       [not found]           ` <mailman.860.1179585463.32220.help-gnu-emacs@gnu.org>
@ 2007-05-19 14:58             ` poppyer
  2007-05-19 14:59             ` Tyler Smith
  1 sibling, 0 replies; 19+ messages in thread
From: poppyer @ 2007-05-19 14:58 UTC (permalink / raw)
  To: help-gnu-emacs

I think it is not emacs's bug.
Because mine works very well here in the TERM=linux console, except the
[home][end] key.

I think this is probably due to distribution-specific termcap setting.
Maybe fire a bug report for the using linux distribution instead.

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> >
> > Well, you're right. Setting TERM=xterm fixed the arrow keys, but
> > page-up and page-down still act funny.
> 
> Open ~/.emacs and then work on this loop:
> 
> 	M-x global-set-key RET <press the key> RET <function binding> RET
> 	C-x Esc Esc C-a C-k C-g		; repeat last command,
> beginning, kill  line, quit
> 	C-x b .emacs RET
> 	C-y
> 
> Finally save ~/.emacs.
> 
> The cursor movement functions are previous-line, next-line, backward-
> char, and forward-char.
> 
> 
> Since there is a file /usr/local/share/emacs/22.1.50/lisp/term/
> linux.el I wonder whether it's worth to write a bug report about the
> behaviour of your GNU Emacs in that "linux" terminal. It would be
> worth to mention the actual key bindings of your system!
> 
> --
> Greetings
> 
>    Pete
> 
> When confronted with actual numbers, a mathematician is at a loss.
>                                           (Steffen Hokland)
> 
> 
> 
> 

-- 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
       [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>
  1 sibling, 2 replies; 19+ messages in thread
From: Tyler Smith @ 2007-05-19 14:59 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-05-19, Peter Dyballa <Peter_Dyballa@Web.DE> wrote:
>
> Since there is a file /usr/local/share/emacs/22.1.50/lisp/term/ 
> linux.el I wonder whether it's worth to write a bug report about the  
> behaviour of your GNU Emacs in that "linux" terminal. It would be  
> worth to mention the actual key bindings of your system!
>

That's probably a good idea. However, it's going to take me some time
to work through all the advice I've been given. It's become apparent
that I need to read up on keymaps in Linux in general in order to
figure out which of my problems are in Emacs, which are in Debian, and
which are in the particular way i've configured each.

Thanks, I appreciate the help!

Tyler

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
  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>
  1 sibling, 0 replies; 19+ messages in thread
From: Peter Dyballa @ 2007-05-19 17:22 UTC (permalink / raw)
  To: Tyler Smith; +Cc: help-gnu-emacs


Am 19.05.2007 um 16:59 schrieb Tyler Smith:

> It's become apparent
> that I need to read up on keymaps in Linux in general in order to
> figure out which of my problems are in Emacs, which are in Debian, and
> which are in the particular way i've configured each.

When I compare xterm.el and vt100.el with linux.el, then I see that  
linux.el does make any key bindings. Reason can be that every Linux  
distribution changes the TERMCAP entry every few months in a  
distribution personalised fashion, so it does not make any sense to  
create sensible key bindings.

The question is why anyone is using such a thing. Xterm can be a  
console, too, it only needs an X server and an option. Are you using  
this "linux" terminal device as a Linux virtual console? Isn't vi  
sufficient for a bit of editing in this situation?

--
Greetings

   Pete     === -Q
              ==<__/% >>
_____________(_)____@_____________________________

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
       [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
  1 sibling, 0 replies; 19+ messages in thread
From: Tyler Smith @ 2007-05-20 15:43 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-05-19, Peter Dyballa <Peter_Dyballa@Web.DE> wrote:
>
> Am 19.05.2007 um 16:59 schrieb Tyler Smith:
>
>> It's become apparent
>> that I need to read up on keymaps in Linux in general in order to
>> figure out which of my problems are in Emacs, which are in Debian, and
>> which are in the particular way i've configured each.
>
>
> The question is why anyone is using such a thing. Xterm can be a  
> console, too, it only needs an X server and an option. Are you using  
> this "linux" terminal device as a Linux virtual console? Isn't vi  
> sufficient for a bit of editing in this situation?
>

Most of the time I actually use Emacs as an x application, but also
often from within an xterm. My experiments with the console are
primarily educational excursions - just trying to figure out how
things work. I won't bother you with more questions on the topic -
I've now been pointed towards a number of resources that will take me
a while to sort through.

Thanks,

Tyler

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
       [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
  1 sibling, 0 replies; 19+ messages in thread
From: Will Parsons @ 2007-05-21 12:03 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa wrote:
> 
> When I compare xterm.el and vt100.el with linux.el, then I see that  
> linux.el does make any key bindings. Reason can be that every Linux  
> distribution changes the TERMCAP entry every few months in a  
> distribution personalised fashion, so it does not make any sense to  
> create sensible key bindings.
> 
> The question is why anyone is using such a thing. Xterm can be a  
> console, too, it only needs an X server and an option. Are you using
                ^^^^^^^^^^^^^^^^^^^^^^^^^
This may not apply to the OP, but I'm surely not the only one who uses
Emacs frequently in situations where there *is* no X-server, not only
in Linux but also in FreeBSD and QNX.

> this "linux" terminal device as a Linux virtual console? Isn't vi  
> sufficient for a bit of editing in this situation?

Not for me it isn't!  I do a *lot* of editing in a console.  As a matter
of fact, it was because I found myself working in an evironment without
X (under QNX) that I really starting using Emacs heavily, since I couldn't
use my previous editor of choice (NEdit).

- Will

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: arrow keys in the console
  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-22  4:38           ` Xavier Maillard
  2 siblings, 0 replies; 19+ messages in thread
From: Xavier Maillard @ 2007-05-22  4:38 UTC (permalink / raw)
  To: Tyler Smith; +Cc: help-gnu-emacs


   Well, you're right. Setting TERM=xterm fixed the arrow keys, but
   page-up and page-down still act funny. How do I load the correct
   keymap?

Are you using the *linux* console (so not an xterm) or what ? If
so, why do you set TERM=xterm for a linux console ? That's very
wrong. All you have to tweak on the linux console side, is to
choose and load the *correct* keymap.

	Xavier
-- 
http://www.gnu.org
http://www.april.org
http://www.lolica.org

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2007-05-22  4:38 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.