Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Funky vi editing escapE in X on alphas... why? any fix?

1 view
Skip to first unread message

Rober...@aol.com

unread,
Jul 25, 2003, 11:13:58 PM7/25/03
to port-...@netbsd.org
I am running into a problem while editing on the Alphas.
Not running X, vi or vim edit correctly, without problems.
In X, twm/xterm, on exit from an input mode escape,
X or the xterm has the very annoying habit of switching
case on the last character entered before the escape,
thusly:

i<cr>
Hello world<escape>

entered into a file, switches case on the final letter,
thusly:

Hello worlD

which is rather annoying whilst editing code or documents
or whatever.

Anyone know what, if any, fix will get around this problem?

Thanks

Bob Keys

(machine is Alpha 3000 M700 with pmagb-ba on NetBSD-1.6U)
(everything else seems to run fine)

der Mouse

unread,
Jul 26, 2003, 12:25:47 AM7/26/03
to port-...@netbsd.org
> i<cr>
> Hello world<escape>

> Hello worlD

I suspect that the escape key is sending some multi-character sequence
involving a tilde. Try ktracing vi so you can see exactly what it's
reading from the tty.

_Fixing_ it is another story entirely, of course. I have no
suggestions for that, though I hope the above will at least get you
looking in the right place.

/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mo...@rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B

David Maxwell

unread,
Jul 26, 2003, 12:35:12 AM7/26/03
to der Mouse, port-...@netbsd.org
On Sat, Jul 26, 2003 at 12:23:33AM -0400, der Mouse wrote:
> > i<cr>
> > Hello world<escape>
>
> > Hello worlD
>
> I suspect that the escape key is sending some multi-character sequence
> involving a tilde. Try ktracing vi so you can see exactly what it's
> reading from the tty.
>
> _Fixing_ it is another story entirely, of course. I have no
> suggestions for that, though I hope the above will at least get you
> looking in the right place.

Try setting the vi option 'escapetime' to > 1 (in units of 100ms) - I
wouldn't normally expect anyone to need this on a local xterm, but it
might help determine whether the problem is vi misinterpreting escape
sequences or something else.

--
David Maxwell, da...@vex.net|da...@maxwell.net --> Although some of you out
there might find a microwave oven controlled by a Unix system an attractive
idea, controlling a microwave oven is easily accomplished with the smallest
of microcontrollers. - Russ Hersch - (Microcontroller primer and FAQ)

Roland Dowdeswell

unread,
Jul 26, 2003, 4:08:40 PM7/26/03
to Rober...@aol.com, port-...@netbsd.org
On 1059189221 seconds since the Beginning of the UNIX epoch
Rober...@aol.com wrote:
>

> i<cr>
> Hello world<escape>
>
>entered into a file, switches case on the final letter,
>thusly:
>
> Hello worlD

Are you sure that you're not pressing F1?

--
Roland Dowdeswell http://www.Imrryr.ORG/~elric/

Rober...@aol.com

unread,
Jul 26, 2003, 10:52:57 PM7/26/03
to el...@imrryr.org, port-...@netbsd.org
On a LK-4xx keyboard, esc is f11.

No, I am not pressing f1 by misteak.....(:+}}...

Thanks

Bob

Rober...@aol.com

unread,
Jul 26, 2003, 11:12:05 PM7/26/03
to da...@crlf.net, mo...@rodents.montreal.qc.ca, port-...@netbsd.org
Setting escapetime>1, e.g., 5, had no effect on the case flipping.

I also noticed that in command mode, just moving a cursor around
and pressing escape at any cursor position flipped the case on the
character wherever the cursor was placed.

Baaaaad karma....(:+\\.....

For now, the only fix seems to edit in vi outside X on this alpha.

Also, the same thing happened using vim.

It does not happen on any of my Sun boxes. Whatever is
doing it may be alpha specific or dec specific.

Vague memory seems to suggest that I saw this happen one
time before, but I am unable to recall on what, exactly. Does this
happen on a pmax box?

Oh, well, that is all I can ferret out, for now....

Thanks

Bob Keys

Carl Lowenstein

unread,
Jul 26, 2003, 11:47:54 PM7/26/03
to port-...@netbsd.org
> From: Rober...@aol.com
> Date: Fri, 25 Jul 2003 23:13:41 EDT
> Subject: Funky vi editing escapE in X on alphas... why? any fix?
> To: port-...@NetBSD.org

>
> I am running into a problem while editing on the Alphas.
> Not running X, vi or vim edit correctly, without problems.
> In X, twm/xterm, on exit from an input mode escape,
> X or the xterm has the very annoying habit of switching
> case on the last character entered before the escape,
> thusly:
>
> i<cr>
> Hello world<escape>
>
> entered into a file, switches case on the final letter,
> thusly:
>
> Hello worlD
>
> which is rather annoying whilst editing code or documents
> or whatever.
>
> Anyone know what, if any, fix will get around this problem?

i<cr>
Hello world<cr>
<escape>

Seems like the simplest solution to me.
But I can't seem to reproduce the original problem.

carl
--
carl lowenstein marine physical lab u.c. san diego
clow...@ucsd.edu

Carl Lowenstein

unread,
Jul 27, 2003, 12:14:24 AM7/27/03
to Rober...@aol.com, da...@crlf.net, mo...@rodents.montreal.qc.ca, port-...@netbsd.org
> From: Rober...@aol.com
> Date: Sat, 26 Jul 2003 23:10:27 EDT
> Subject: Re: Funky vi editing escapE in X on alphas... why? any fix?
> To: da...@crlf.net, mo...@Rodents.Montreal.QC.CA
> CC: port-...@NetBSD.org

>
> Setting escapetime>1, e.g., 5, had no effect on the case flipping.
>
> I also noticed that in command mode, just moving a cursor around
> and pressing escape at any cursor position flipped the case on the
> character wherever the cursor was placed.
>
> Baaaaad karma....(:+\\.....

Keyboard setup. Your F11 key is not mapped to <esc> but to some
other combination which includes ~ and also <esc>/

> For now, the only fix seems to edit in vi outside X on this alpha.
>
> Also, the same thing happened using vim.
>
> It does not happen on any of my Sun boxes. Whatever is
> doing it may be alpha specific or dec specific.
>
> Vague memory seems to suggest that I saw this happen one
> time before, but I am unable to recall on what, exactly. Does this
> happen on a pmax box?

What happens in an xterm window from from a shell prompt if you run "od -cb"
I try here, with input: <esc>,x,x,<ctrl>[,x,x,<cr>,<ctrl>d
(commas just to show separate characters, not to be typed)

[cdl@iota cdl]$ od -cb
^[xx^[xx
0000000 033 x x 033 x x \n
033 170 170 033 170 170 012
0000007
[cdl@iota cdl]$

carl
--
carl lowenstein marine physical lab u.c. san diego
clow...@ucsd.edu


$

Jochen Kunz

unread,
Jul 27, 2003, 9:40:58 AM7/27/03
to Rober...@aol.com, port-...@netbsd.org
On 2003.07.26 19:52 Rober...@aol.com wrote:

> No, I am not pressing f1 by misteak.....(:+}}...

CTRL-3 should be equivalent to ESC too.
What do you get with xev(1)?
--

tschüß,
Jochen

Homepage: http://www.unixag-kl.fh-kl.de/~jkunz

Rober...@aol.com

unread,
Jul 27, 2003, 2:05:51 PM7/27/03
to jk...@unixag-kl.fh-kl.de, port-...@netbsd.org
The sequences set using ctrl-[ work, but using f11 I get
the sequence ctrl[[23" from od-cb. xev gives for f11
a keycode 35 (keysym 0xffc8, F11). xev for ctrl-[ gives
a keycode 97 (keysym 0xffe3, Control_L) followed by
a keycode 172 (keysym 0x5b, bracketleft).

If the ctrl-[ works and not the f11, in X, then something
is not passing the codes correctly to vi, while in X?

Bob Keys

Rober...@aol.com

unread,
Jul 27, 2003, 2:16:21 PM7/27/03
to jk...@unixag-kl.fh-kl.de, port-...@netbsd.org
ctrl-3 also works correctly. Why not the usual dec f11?
I really hate to be two-fisted in vi, not to start editor wars...
IFF we really want to be doing it well, f11 should always
work for esc on dec gear, at least in vi. After all, if one
is using a DEC LK2xx keyboard, it is marked on the little
grey label strip under the folding plastic window? (:+}}...

Bob Keys

der Mouse

unread,
Jul 27, 2003, 2:41:58 PM7/27/03
to port-...@netbsd.org
> The sequences set using ctrl-[ work, but using f11 I get the sequence
> ctrl[[23" from od-cb. xev gives for f11 a keycode 35 (keysym
> 0xffc8, F11). xev for ctrl-[ gives a keycode 97 (keysym 0xffe3,
> Control_L) followed by a keycode 172 (keysym 0x5b, bracketleft).

It appears that your F11 is not, after all, the Escape you thought it
was. If you've meddled with the xmodmap settings for keycode 35, this
is probably your fault; if not, it's the X server's fault (if fault it
truly is).

> If the ctrl-[ works and not the f11, in X, then something is not
> passing the codes correctly to vi, while in X?

FSVO "correctly", yes. If F11 is the key people expect to press for
escape, then keycode 35 should have Escape as its keysym, not F11. Why
this is not so is the question.

As a workaround, you can use xmodmap to put Escape, instead of F11, on
keycode 35. But you really shouldn't have to do that.

Rober...@aol.com

unread,
Jul 27, 2003, 3:02:53 PM7/27/03
to mo...@rodents.montreal.qc.ca, port-...@netbsd.org
It's nobody's fault, and I have not meddled with anything.
Stock 100% (except for redoing the xinitrc layout... why
does NetBSD have such an ugly first boot of X?). The
problem is that f11 is the standard DEC escape and
has been for as far back as I can recall, and it is not
working in X on NetBSD on my stock alpha. So, how
to properly fix it? Vi itself seems to be handling things
correctly, but X is messing up the usual f11 mapping.
So, should it be changed... I think so. Can it be changed
... I think so. What is the correct change... I'm too stupid
to know, right now. Any insights are appreciated.

Thanks

Bob Keys

Carl Lowenstein

unread,
Jul 28, 2003, 1:31:50 PM7/28/03
to Rober...@aol.com, jk...@unixag-kl.fh-kl.de, port-...@netbsd.org
> From: Rober...@aol.com
> Date: Sun, 27 Jul 2003 14:05:26 EDT

> Subject: Re: Funky vi editing escapE in X on alphas... why? any fix?
> To: jk...@unixag-kl.fh-kl.de
> CC: port-...@NetBSD.org

>
> The sequences set using ctrl-[ work, but using f11 I get
> the sequence ctrl[[23" from od-cb. xev gives for f11
> a keycode 35 (keysym 0xffc8, F11). xev for ctrl-[ gives
> a keycode 97 (keysym 0xffe3, Control_L) followed by
> a keycode 172 (keysym 0x5b, bracketleft).
>
> If the ctrl-[ works and not the f11, in X, then something
> is not passing the codes correctly to vi, while in X?

If od-cb gives <ctrl>[ [ 2 3 ~ for <F11>
which it does on my Solaris system and also a Linux system,
and also on your NetBSD VAX, the problem is not limited to vi.

It seems to be part of X, whatever translates keycodes into
ASCII equivalents. This is further inside X than I want to go
today. :-)

But it looks like VT220 keycode translation is being done,
while you want VT100.

carl

0 new messages