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
> 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
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
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-----
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.
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-----
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 <dic...@invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net