Re: RDS! ed in FreeBSD
- Posted by "C. K. Lester" <euphoric at cklester.com> Oct 16, 2003
- 455 views
> C. K. Lester wrote: > > > > For example, when I press my up arrow, I get the top-line prompt and > > "0A" is printed at the prompt. That's the second and third number of the > > sequence returned by wait_key(). So why is ed.ex not responding to it?! > > For you, up-arrow generates 27 79 65 > It's as if you had typed: Esc 'O' 'A' I figured as much, but in the code you trap the first ESCAPE value (27) and check for the subseqeunt values. > Maybe on your machine, the escape sequence stream, > as seen by wait_key/get_key, has -1 after Esc so ed > thinks you actually typed Esc followed by O and A. I don't see any -1 when i run key, using either get_key() or wait_key(). > You might have to choose another key to perform the > function of Esc, or maybe you need to allow for a couple > of -1's between escape sequence codes. So, after trapping ESCAPE, should I do something like while a[1] = -1 do a = a[2..length(a)] end while and strip those out first? Unfortunately, I'm at work right now, so this will have to wait 'til tonight. :)