unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* C-Home, C-End doesn't work in gnome-terminal - any idea why?
@ 2009-10-22  9:59 "Peter Valdemar Mørch (Lists)"
  2009-10-26  9:47 ` "Peter Valdemar Mørch (Lists)"
  0 siblings, 1 reply; 10+ messages in thread
From: "Peter Valdemar Mørch (Lists)" @ 2009-10-22  9:59 UTC (permalink / raw)
  To: help-gnu-emacs

I don't seem to be able to generate C-home,C-end keyboard sequences from 
a gnome-terminal.

Anybody have any idea why? Or how to tweek either emacs or 
gnome-terminal to make it behave right? I realize this may be a gnome 
issue, but then please let me know that if you know that for sure. I 
decided to start here.

To reproduce:

* Start "emacs -nw" in a gnome-terminal
* Type : C-h c C-home

Expected output:
<C-home> runs the command beginning-of-buffer

Actual output:
<home> runs the command move-beginning-of-line

(pretty much the same for C-end too)

If I omit the -nw parameter, so emacs opens in a separate X window or if 
I run it from an xterm instead of gnome-terminal, it also works.

Using the short perl snippet below, xterm produces this output when I 
hit C-home:
  Decimal: 27    Hex: 1b
  Decimal: 91    Hex: 5b
  Decimal: 49    Hex: 31
  Decimal: 59    Hex: 3b
  Decimal: 53    Hex: 35
  Decimal: 72    Hex: 48

While gnome terminal produces this output:
  Decimal: 27	Hex: 1b
  Decimal: 79	Hex: 4f
  Decimal: 72	Hex: 48

Clearly this is different. Is that enough to point the finger at 
gnome-terminal? Or is there a 'take-foobar-into-account' setting 
somewhere in either emacs, terminals, xmodmap or other voodoo?

I've used stty to produce the same settings for both terminals - no dice 
   - they still behave differently.

But I sometimes have to use emacs over a slow terminal, and I like to 
use gnome-terminals. Yes, I know I can use M-< and M->, but C-home is in 
my fingers from the X version. I hope I can get C-home, C-end to work! :-)

Thanks for reading this far.

Sincerely,

Peter

Perl snippet to see keyboard "chars":

#!/usr/bin/perl -w

use Term::ReadKey;
ReadMode('cbreak');
print "Press keys to see their ASCII values.  Use Ctrl-C to quit.\n";

while (1) {
     $char = ReadKey(0);
     last unless defined $char;
     printf(" Decimal: %d\tHex: %x\n", ord($char), ord($char));
}

ReadMode('normal');

-- 
Peter Valdemar Mørch
http://www.morch.com




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

* C-Home, C-End doesn't work in gnome-terminal - any idea why?
@ 2009-10-23  7:31 Peter Valdemar Mørch
  2009-10-23 15:21 ` Peter Dyballa
  2009-10-24  6:00 ` tomas
  0 siblings, 2 replies; 10+ messages in thread
From: Peter Valdemar Mørch @ 2009-10-23  7:31 UTC (permalink / raw)
  To: help-gnu-emacs

I don't seem to be able to generate C-home,C-end keyboard sequences from
a gnome-terminal.

Anybody have any idea why? Or how to tweek either emacs or
gnome-terminal to make it behave right? I realize this may be a gnome
issue, but then please let me know that if you know that for sure. I
decided to start here.

To reproduce:

* Start "emacs -nw" in a gnome-terminal
* Type : C-h c C-home

Expected output:
<C-home> runs the command beginning-of-buffer

Actual output:
<home> runs the command move-beginning-of-line

(pretty much the same for C-end too)

If I omit the -nw parameter, so emacs opens in a separate X window or if
I run it from an xterm instead of gnome-terminal, it also works.

Using the short perl snippet below, xterm produces this output when I
hit C-home:
  Decimal: 27    Hex: 1b
  Decimal: 91    Hex: 5b
  Decimal: 49    Hex: 31
  Decimal: 59    Hex: 3b
  Decimal: 53    Hex: 35
  Decimal: 72    Hex: 48

While gnome terminal produces this output:
  Decimal: 27	Hex: 1b
  Decimal: 79	Hex: 4f
  Decimal: 72	Hex: 48

Clearly this is different. Is that enough to point the finger at
gnome-terminal? Or is there a 'take-foobar-into-account' setting
somewhere in either emacs, terminals, xmodmap or other voodoo?

I've used stty to produce the same settings for both terminals - no dice
   - they still behave differently.

But I sometimes have to use emacs over a slow terminal, and I like to
use gnome-terminals. Yes, I know I can use M-< and M->, but C-home is in
my fingers from the X version. I hope I can get C-home, C-end to work! :-)

Thanks for reading this far.

Sincerely,

Peter

Perl snippet to see keyboard "chars":

#!/usr/bin/perl -w

use Term::ReadKey;
ReadMode('cbreak');
print "Press keys to see their ASCII values.  Use Ctrl-C to quit.\n";

while (1) {
     $char = ReadKey(0);
     last unless defined $char;
     printf(" Decimal: %d\tHex: %x\n", ord($char), ord($char));
}

ReadMode('normal');

-- 
Peter Valdemar Mørch
http://www.morch.com





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

* Re: C-Home, C-End doesn't work in gnome-terminal - any idea why?
  2009-10-23  7:31 C-Home, C-End doesn't work in gnome-terminal - any idea why? Peter Valdemar Mørch
@ 2009-10-23 15:21 ` Peter Dyballa
  2009-10-23 19:39   ` "Peter Valdemar Mørch (Lists)"
  2009-10-24  6:00 ` tomas
  1 sibling, 1 reply; 10+ messages in thread
From: Peter Dyballa @ 2009-10-23 15:21 UTC (permalink / raw)
  To: Peter Valdemar Mørch; +Cc: help-gnu-emacs


Am 23.10.2009 um 09:31 schrieb Peter Valdemar Mørch:

> I don't seem to be able to generate C-home,C-end keyboard sequences  
> from
> a gnome-terminal.


What is the value of the environment variable TERM? Are you able to  
correct it?

--
Greetings

   Pete

"No man was ever taken to hell by a woman unless he already had a  
ticket in his pocket, or at least had been fooling around with  
timetables."
				– Archie Goodwin







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

* Re: C-Home, C-End doesn't work in gnome-terminal - any idea why?
  2009-10-23 15:21 ` Peter Dyballa
@ 2009-10-23 19:39   ` "Peter Valdemar Mørch (Lists)"
  0 siblings, 0 replies; 10+ messages in thread
From: "Peter Valdemar Mørch (Lists)" @ 2009-10-23 19:39 UTC (permalink / raw)
  To: Peter Dyballa; +Cc: help-gnu-emacs

Peter Dyballa Peter_Dyballa-at-Web.DE |Lists| wrote:
> What is the value of the environment variable TERM? Are you able to 
> correct it?

Thanks Peter, for your reply.

I hadn't thought of TERM. But TERM=xterm in both xterm and 
gnome-terminal. I tried unsetting TERM, but that gave this error:
Please set the environment variable TERM; see `tset'.

So I don't know what else to try there.

Peter

-- 
Peter Valdemar Mørch
http://www.morch.com




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

* Re: C-Home, C-End doesn't work in gnome-terminal - any idea why?
  2009-10-23  7:31 C-Home, C-End doesn't work in gnome-terminal - any idea why? Peter Valdemar Mørch
  2009-10-23 15:21 ` Peter Dyballa
@ 2009-10-24  6:00 ` tomas
  2009-10-24 10:33   ` "Peter Valdemar Mørch (Lists)"
  1 sibling, 1 reply; 10+ messages in thread
From: tomas @ 2009-10-24  6:00 UTC (permalink / raw)
  To: Peter Valdemar Mørch; +Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Oct 23, 2009 at 09:31:44AM +0200, Peter Valdemar Mørch wrote:
> I don't seem to be able to generate C-home,C-end keyboard sequences from
> a gnome-terminal.

I'd guess it's gnome-terminal eating the keystrokes. Try the following
experiment (on a shell on a Gnome terminal, that is :)

  hexdump -C

Then type away at it. You should see a hexdump of your input. Then type
CTRL-Home. Does hexdump "see" it?

Now go to the terminal's menu "Edit->Keyboard Shortcuts". On mine theere
is a "Disable all menu access keys". This one fixed it for me.

HTH
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFK4pgBBcgs9XrR2kYRAhBiAJ9/UFFVZv8CTC6EM8l6xRp6tmD5vQCfWzFD
t7r4SmARB3k70602MCyN93s=
=mhLm
-----END PGP SIGNATURE-----




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

* Re: C-Home, C-End doesn't work in gnome-terminal - any idea why?
  2009-10-24  6:00 ` tomas
@ 2009-10-24 10:33   ` "Peter Valdemar Mørch (Lists)"
  2009-10-26 13:36     ` tomas
       [not found]     ` <mailman.9494.1256563986.2239.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: "Peter Valdemar Mørch (Lists)" @ 2009-10-24 10:33 UTC (permalink / raw)
  To: tomas; +Cc: help-gnu-emacs

tomas-at-tuxteam.de |Lists| wrote:
> I'd guess it's gnome-terminal eating the keystrokes. Try the following
> experiment (on a shell on a Gnome terminal, that is :)
> 
>   hexdump -C
> 
> Then type away at it. You should see a hexdump of your input. Then type
> CTRL-Home. Does hexdump "see" it?

hexdump -C produces output showing the same hex values that my perl 
snippet did in the OP:

gnome-terminal:
^[OH00000000  1b 4f 48                                          |.OH|
00000003
xterm:
^[[1;5H00000000  1b 5b 31 3b 35 48                                 |.[1;5H|
00000006

It doesn't seem that gnome-terminal "eats" the keystrokes, it just 
produces other keystrokes than xterm does.

> Now go to the terminal's menu "Edit->Keyboard Shortcuts". On mine theere
> is a "Disable all menu access keys". This one fixed it for me.

On mine (current ubuntu jaunty - gnome-terminal v. 2.26.0) there are two 
settings under Edit / Keyboard Shortcuts: "Enable menu access keys" and 
"Enable the menu shortcut key". Whether or not they are enabled makes no 
difference.

Thanks for taking the time to post, Thomas.

Peter

-- 
Peter Valdemar Mørch
http://www.morch.com




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

* Re: C-Home, C-End doesn't work in gnome-terminal - any idea why?
  2009-10-22  9:59 "Peter Valdemar Mørch (Lists)"
@ 2009-10-26  9:47 ` "Peter Valdemar Mørch (Lists)"
  0 siblings, 0 replies; 10+ messages in thread
From: "Peter Valdemar Mørch (Lists)" @ 2009-10-26  9:47 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Valdemar Mørch (Lists)4ux6as402-at-sneakemail.com |Lists| wrote:
> I don't seem to be able to generate C-home,C-end keyboard sequences from 
> a gnome-terminal.

This really does seem to be a problem with gnome-terminal. C-Home,C-end 
don't work in vim either. These keys do work in X-versions of vim and in
vim in real xterms... I also discovered, that gnome-terminal sends the 
exact same keys to "emacs -nw" for both <Home> and C-<Home>. So emacs 
doesn't stand a chance...

I've posted this bug with gnome-terminal:

https://bugzilla.gnome.org/show_bug.cgi?id=599634

Peter
-- 
Peter Valdemar Mørch
http://www.morch.com




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

* Re: C-Home, C-End doesn't work in gnome-terminal - any idea why?
  2009-10-24 10:33   ` "Peter Valdemar Mørch (Lists)"
@ 2009-10-26 13:36     ` tomas
       [not found]     ` <mailman.9494.1256563986.2239.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: tomas @ 2009-10-26 13:36 UTC (permalink / raw)
  To: Peter Valdemar Mørch (Lists); +Cc: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, Oct 24, 2009 at 12:33:19PM +0200, "Peter Valdemar Mørch (Lists)" wrote:
> tomas-at-tuxteam.de |Lists| wrote:
>> I'd guess it's gnome-terminal eating the keystrokes. Try the following
>> experiment (on a shell on a Gnome terminal, that is :)

[...]

> Thanks for taking the time to post, Thomas.

Uh -- sorry. I should have read your original post more carefully -- I
could have deduced from there that the keystrokes weren't being eaten.
Now I can reproduce the problem -- in /usr/share/terminfo I count 10
entries for gnome-xxx terminals. Most of them show the behaviour you
describe, three of them (gnome+pcfkeys, gnome-rh72, gnome-rh80) are even
weirder (mapping C-Home to M-o h).

Seems the terminfo entries for gnome-terminal aren't up to snuff :-/

(Those kids nowadays don't use terminals that much, rant, rant :)

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFK5aXNBcgs9XrR2kYRAlOJAJ4oJzT2Bz2sI3RygVAw6ZMVWJguFACeMy4S
D5ce2K9J3BByqtPDX8Oah/A=
=hMy7
-----END PGP SIGNATURE-----




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

* Re: C-Home, C-End doesn't work in gnome-terminal - any idea why?
       [not found]     ` <mailman.9494.1256563986.2239.help-gnu-emacs@gnu.org>
@ 2009-10-26 21:09       ` dickey
  0 siblings, 0 replies; 10+ messages in thread
From: dickey @ 2009-10-26 21:09 UTC (permalink / raw)
  To: help-gnu-emacs

On Oct 26, 9:36 am, to...@tuxteam.de wrote:
> entries for gnome-xxx terminals. Most of them show the behaviour you
> describe, three of them (gnome+pcfkeys, gnome-rh72, gnome-rh80) are even
> weirder (mapping C-Home to M-o h).

gnome+pckeys is a building block (as noted in terminfo.src).
The other two are observations of gnome-terminal...

> Seems the terminfo entries for gnome-terminal aren't up to snuff :-/

perhaps (since gnome-terminal's behavior changes randomly and
abberantly,
it's a low-grade moving target).  For further amusement, read its bug
reports.

--
Thomas E. Dickey <dickey@invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net


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

* Re: C-Home, C-End doesn't work in gnome-terminal - any idea why?
       [not found] <mailman.9325.1256309732.2239.help-gnu-emacs@gnu.org>
@ 2016-08-17  6:40 ` pmorch
  0 siblings, 0 replies; 10+ messages in thread
From: pmorch @ 2016-08-17  6:40 UTC (permalink / raw)
  To: help-gnu-emacs

It is a bug in libvte[1]. Is fixed in newer versions of libvte, but there are no plans to backport it to the versions currently in use.

1: https://bugzilla.gnome.org/show_bug.cgi?id=600659


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

end of thread, other threads:[~2016-08-17  6:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-23  7:31 C-Home, C-End doesn't work in gnome-terminal - any idea why? Peter Valdemar Mørch
2009-10-23 15:21 ` Peter Dyballa
2009-10-23 19:39   ` "Peter Valdemar Mørch (Lists)"
2009-10-24  6:00 ` tomas
2009-10-24 10:33   ` "Peter Valdemar Mørch (Lists)"
2009-10-26 13:36     ` tomas
     [not found]     ` <mailman.9494.1256563986.2239.help-gnu-emacs@gnu.org>
2009-10-26 21:09       ` dickey
     [not found] <mailman.9325.1256309732.2239.help-gnu-emacs@gnu.org>
2016-08-17  6:40 ` pmorch
  -- strict thread matches above, loose matches on Subject: below --
2009-10-22  9:59 "Peter Valdemar Mørch (Lists)"
2009-10-26  9:47 ` "Peter Valdemar Mørch (Lists)"

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).