[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
C-Home, C-End doesn't work in gnome-terminal - any idea why?
From: |
Peter Valdemar Mørch |
Subject: |
C-Home, C-End doesn't work in gnome-terminal - any idea why? |
Date: |
Fri, 23 Oct 2009 09:31:44 +0200 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20090817) |
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