9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@swtch.com>
To: 9fans@9fans.net
Subject: Re: [9fans] sam question
Date: Fri, 18 Jul 2008 09:22:36 -0400	[thread overview]
Message-ID: <20080718131954.E1B4B1E8C22@holo.morphisms.net> (raw)
In-Reply-To: <df49a7370807180301y1e0d7d58x398023b33efd39d2@mail.gmail.com>

> interestingly this only works in some versions of acme and sam.
> it seems to work ok under plan 9, and in inferno's acme,
> but not in p9p or acme sac.

There are two different issues here.  One is getting
an actual \r to the program in question (acme, sam, etc.)
and the second is how that program interprets it.

The first issue is getting a \r to the program.
On most systems, you type \r.  On Windows,
Enter sends \r so the keyboard handler swaps \r and \n,
so you type Ctl-J to get \r.  (If anyone cared, I think
you could check for Ctl in the input handler and not
swap in that case.)  This applies to drawterm, inferno,
and 9pm, which all share the same gui code (I think 9pm
is the progenitor).

The second issue is what the program thinks \r is.
There's a long, boring history of Plan 9 coming to
grips with the many extra keys on the PC keyboard,
but the short version is that for a long time the End key's
only use was to generate \r.  That era ended in
December 2003, around the time rio, sam, and acme
started using Home, End, PgUp, and PgDown for
scrolling.  Unfortunately, the p9p keyboard.h didn't
get the memo, and it was still using \r as End.
This meant that when you typed Ctl-M acme or sam
saw End (and probably didn't scroll because you were
in a window with little text).  I just fixed this in p9p
cvs and hg.  (I had always chalked it up to an X11 input
issue similar to the Windows one, or I'd have gone
looking for it years ago.)

I can't explain why acme sac doesn't handle \r right,
but now you know where to look.

Russ



  reply	other threads:[~2008-07-18 13:22 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-17 22:56 Skip Tavakkolian
2008-07-18  0:28 ` erik quanstrom
2008-07-18  0:45   ` Pietro Gagliardi
2008-07-18 10:01     ` roger peppe
2008-07-18 13:22       ` Russ Cox [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-08-20 12:06 [9fans] Sam question bwc
2001-08-19 18:06 rob pike
2001-08-19 15:05 bwc
2001-08-19 15:59 ` Boyd Roberts
2001-08-19 12:44 rob pike
2001-08-18  7:38 nigel
2001-08-18  8:31 ` Steve Kilbane
2001-08-20  8:57   ` Luis Fernandes
2001-08-20 11:10     ` Boyd Roberts
2001-08-18 11:06 ` Boyd Roberts
2001-08-19  6:57 ` Lucio De Re
2001-08-19 10:54   ` Boyd Roberts
2001-08-19 11:13     ` Lucio De Re
2001-08-19 12:02       ` Boyd Roberts
2001-08-19 12:23         ` Lucio De Re
2001-08-19 16:17           ` Steve Kilbane
2001-08-19 20:57 ` Dan Cross
2001-08-17 22:35 David Gordon Hogan
2001-08-18  4:47 ` Rick Hohensee
2001-08-19  6:29 ` Lucio De Re
2001-08-17 22:22 geoff
2001-08-17 17:00 rob pike
2001-08-17 16:32 David Gordon Hogan
2001-08-17 16:55 ` Lucio De Re
2001-08-17 17:08   ` Boyd Roberts
2001-08-17 17:28   ` Louis Beleos
2001-08-17 17:45     ` Lucio De Re
2001-08-17 17:04 ` Boyd Roberts
2001-08-17 17:04 ` Steve Kilbane
2001-08-18  1:36   ` Boyd Roberts
2001-08-19  6:31     ` Lucio De Re
2001-08-17 14:22 rob pike
2001-08-17 14:15 rob pike
2001-08-17 16:58 ` Boyd Roberts
2001-08-20  8:56 ` Douglas A. Gwyn
2001-08-14 12:41 rob pike
2001-08-08 10:45 [9fans] ls -R rog
2001-08-08 17:08 ` [9fans] Sam question gene garbutt
2001-08-14  9:44   ` Douglas A. Gwyn
2001-08-16 21:07     ` Boyd Roberts
2001-08-17  8:50       ` Douglas A. Gwyn
2001-08-17 12:14         ` Boyd Roberts
2001-08-20  8:56           ` Douglas A. Gwyn
2001-08-20 11:11             ` Boyd Roberts
2001-08-20 16:25             ` Sam Ducksworth
2001-08-20 15:11               ` Boyd Roberts
2001-08-21  8:37                 ` Ozan Yigit
2001-08-21  9:31                   ` Boyd Roberts
2001-08-22  2:52                     ` Donald Brownlee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080718131954.E1B4B1E8C22@holo.morphisms.net \
    --to=rsc@swtch.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).