Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-28 Thread Lapo Luchini
Some brain-deadness (probably jet-lag-related) didn't let me see this
message yesterday (even if I searched for "recent thread with the word
'rxvt' in the Subject"...), but with new rxvt*-6 I also have problems
with Alt-BackSpace deleting TWO words instead of one, so there may be
some more to this problem than it appears?... =)

Also, something has changed with font management, I guess, but I hope
the announce of the new package will tell about that...

http://article.gmane.org/gmane.os.cygwin/91847

-- 
Lapo Luchini
[EMAIL PROTECTED] (OpenPGP & X.509)
www.lapo.it (Jabber, ICQ, MSN)


Re: rxvt package default TERM value [Was: RXVT doesn't recognize ALT + Cursor keys]

2007-08-22 Thread Corinna Vinschen
On Aug 21 23:00, Charles Wilson wrote:
> Corinna Vinschen wrote:
> >Works fine, including all keys I'm used to after I replaced the
> >rxvt entries on the affected Linux system.
> 
> So, any opinions on what value rxvt should give for TERM, when the user 
> has not specified a value[*].  Existing behavior on cygwin (and most 
> other platforms) is to report 'xterm'.  rxvt-20050409-5 test release 
> reports 'rxvt'.

IMHO rxvt should just stick to its xterm default as on other platforms.
It's simple enough to set the terminal name.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


rxvt package default TERM value [Was: RXVT doesn't recognize ALT + Cursor keys]

2007-08-21 Thread Charles Wilson

Corinna Vinschen wrote:

Works fine, including all keys I'm used to after I replaced the
rxvt entries on the affected Linux system.


So, any opinions on what value rxvt should give for TERM, when the user 
has not specified a value[*].  Existing behavior on cygwin (and most 
other platforms) is to report 'xterm'.  rxvt-20050409-5 test release 
reports 'rxvt'.


--
Chuck




[*] there are five ways to specify the desired TERM value -- or any 
resource setting -- from highest priority down to lowest):

 (1) command line argument: -tn
 (2) ~/.Xdefaults or ~/.Xresources contains [**]
(a) prog*termName where prog is the invocation name of the
application (usually "rxvt" all lowercase)
(b) Rxvt*termName
 (3) /etc/X11/app-defaults/Rxvt contains Rxvt*termName [***]
 (4) /etc/X11/app-defaults/Rxvt contains *termName
 (5) ~/.Xdefaults or ~/.Xresources contains
(a) XTerm*termName
(b) *termName


[**] cygwin's rxvt explicitly parses these files manually.  It does not 
access the xserver's resources database, even in X11 mode.  (The 
opposite behavior can be obtained by modified some macros in 
src/feature.h and src/rxvt.h, and recompiling).


[***] could be /etc/X11/locale//app-defaults/Rxvt if locale is 
set to something, but this is untested given cygwin's (newlib's) lack of 
support for true locales.


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-21 Thread Corinna Vinschen
On Aug 20 23:36, Charles Wilson wrote:
> Charles Wilson wrote:
> >Thanks.  I'll include this in the next build.  In fact, I'm going to 
> >generate a test release using this patch, and --with-term=rxvt -- but 
> >without the 'make cygwin rxvt act like xterm, even though all other rxvt 
> >do not' patch.  I really think that issue is a bug in your 
> >termcap/terminfo files, because mine don't specify the things your do. 
> >I'll post an archive with my precompiled terminfo/r/rxvt* files and 
> >/etc/termcap, for testing.
> 
> rxvt-20050409-5 should propagate to the mirrors soon (as test release). 
>  Try it with the attached termcap/terminfo files.

Works fine, including all keys I'm used to after I replaced the
rxvt entries on the affected Linux system.


Thanks!
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-21 Thread Corinna Vinschen
On Aug 20 22:57, Charles Wilson wrote:
> Corinna Vinschen wrote:
> >On further looking into this, it appears that the termcap/terminfo
> >entries are wrong.  ESC O A to ESC O D are only generated after
> >entering the DEC expanded cursor mode with ESC [ ? 1 h.  The default
> >codes are ESC [ A to ESC [ D. 
> 
> 
> From what I can tell, the "expanded" codes SHOULD be
>ESC [ n A   where n is 1-9, not 0  (and '[' should be there)
> and should be emitted when in DECCKM mode.  This stuff is all handled in 
> src/command.c but it's a twisty maze that all looks the same.

No, that's not quite right.  It's O as in "O my god!", not 0 as in
01100101, and it's actually without [.  Try this with an xterm:

$ od -c
^[[D^[[A^[[B^[[C
000 033   [   D 033   [   A 033   [   B 033   [   C  \n
015
$ echo '^[[?1h'

$ od -c
^[OD^[OA^[OB^[OC
000 033   O   D 033   O   A 033   O   B 033   O   C  \n
015
$ 

See http://vt100.net/docs/vt220-rm/chapter4.html#S4.6.8 for how to
set the cursor mode, http://vt100.net/docs/vt220-rm/table3-2.html
for the escape sequences and
http://vt100.net/docs/vt220-rm/chapter2.html#S2.5.1 for the meaning
of CSI and SS3.

Unfortunately the vt220 manual isn't much help when it comes to the
"Home" and "End" keys, because it has "Find" and "Select" in it's place.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-21 Thread Corinna Vinschen
On Aug 20 22:35, Charles Wilson wrote:
> I used to have to fix my /etc/termcap. But now the /etc/termcap in 
> termcap-20050421-1.tar.bz2 says:
> 
> rxvt|rxvt terminal emulator (X Window System):\
> :am:eo:km:mi:ms:xn:xo:\
> :co#80:it#8:li#24:\
> :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
> :K1=\EOw:K2=\EOu:K3=\EOy:K4=\EOq:K5=\EOs:LE=\E[%dD:\
> :RI=\E[%dC:UP=\E[%dA:ae=^O:al=\E[L:as=^N:bl=^G:cd=\E[J:\
> :ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=^M:\
> :cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=^J:ei=\E[4l:\
> :ho=\E[H:i1=\E[?47l\E=\E[?1l:ic=\E[@:im=\E[4h:\
> :is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l:\
> :k0=\E[21~:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:\
> :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:\
> :kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=^H:kd=\E[B:ke=\E>:\
> :kh=\E[7~:kl=\E[D:kr=\E[C:ks=\E=:ku=\E[A:le=^H:mb=\E[5m:\
> :md=\E[1m:me=\E[m\017:mr=\E[7m:nd=\E[C:rc=\E8:sc=\E7:\
> :se=\E[27m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:\
> :te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:ue=\E[24m:up=\E[A:\
> :us=\E[4m:vb=\E[?5h\E[?5l:ve=\E[?25h:vi=\E[?25l:\
> :vs=\E[?25h:
> rxvt-cygwin-native|rxvt terminal emulator (native MS Window System port) 
> on cygwin:\
> 
> :ac=+\257,\256-^0\333`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o
> ~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330~\376:\
> :tc=rxvt:

I missed to tell that I'm talking about terminfo on Linux and now that
I compare terminfo entries on different Linux distros, I see that they
disagree about the rxvt settings:

Red Hat Enterprise Linux 4:
$ rpm -qf /usr/share/terminfo/r/rxvt-basic 
ncurses-5.4-13
$ infocmp -I rxvt-basic | grep 'cu[bfu]1'
cub1=^H, cnorm=\E[?25h, cuf1=\E[C, cuu1=\E[A, dch1=\E[P, 
kcub1=\E[D, kmous=\E[M, knp=\E[6~, kpp=\E[5~, kcuf1=\E[C, 

OpenSuSE 10.2:
$ rpm -qf /usr/share/terminfo/r/rxvt-basic 
terminfo-5.5-42
$ infocmp -I rxvt-basic | grep 'cu[bfu]1'
cub1=^H, cnorm=\E[?25h, cuf1=\E[C, cuu1=\E[A, 
kich1=\E[2~, kcub1=\EOD, kmous=\E[M, knp=\E[6~, kpp=\E[5~, 
kcuf1=\EOC, kDC=\E[3$, kslt=\E[4~, kEND=\E[8$, kHOM=\E[7$, 
kLFT=\E[d, kNXT=\E[6$, kPRV=\E[5$, kRIT=\E[c, kcuu1=\EOA, 

> #2) For termcap, the arrow key spellings are:
>kd=\E[B  ku=\E[A  kl=\E[D  kr=\E[C

Same picture here:

Red Hat Enterprise Linux 4:
$ rpm -qf /etc/termcap
termcap-5.4-3
The termcap entry for rxvt-basic has
 kd=\E[B  ku=\E[A  kl=\E[D  kr=\E[C

OpenSuSE 10.2:
$ rpm -qf /etc/termcap
ncurses-5.5-42
The termcap entry for rxvt-basic has
 kd=\EOB  ku=\EOA  kl=\EOD  kr=\EOC

> So again, I don't see where you're getting ESC O A from that.  Are you 
> sure your installed termcap and terminfo files haven't been corrupted? 

Unfortunately I was playing with the OpenSuSE installation while
debugging rxvt, and I only tested Cygwin's rxvt against the SuSE box.
Apparently the termcap/terminfo entries (same as above for the other
rxvt entries) are broken on SuSE.  Weird.  That should be a lesson to
me, I guess...

> I really believe The Right Thing To Do is to ensure /etc/termcap and 
> and/usr/share/terminfo/ are up to date, rather than make rxvt's terminal 
> handling on cygwin different than on all other platforms.

Yes, I agree.

> But even there, IF you have plain old 'rxvt' in your termcap, that's 
> usually good enough unless you're a stickler for line art characters. 
> rxvt's TERM setting defaults to xterm only because it will almost ALWAYS 
> be present, and will *mostly* work.

It doesn't have to do with line art.  If cursor and home/end keys don't
work, you have, for instance, problems moving in mutt's menus.

> Comments?

I was working under the premise that different Linux distros wouldn't
differ in such essential details.  Oh well...


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Charles Wilson

Charles Wilson wrote:
Thanks.  I'll include this in the next build.  In fact, I'm going to 
generate a test release using this patch, and --with-term=rxvt -- but 
without the 'make cygwin rxvt act like xterm, even though all other rxvt 
do not' patch.  I really think that issue is a bug in your 
termcap/terminfo files, because mine don't specify the things your do. 
I'll post an archive with my precompiled terminfo/r/rxvt* files and 
/etc/termcap, for testing.


rxvt-20050409-5 should propagate to the mirrors soon (as test release). 
 Try it with the attached termcap/terminfo files.


--
Chuck


rxvt-term.tar.bz2
Description: Binary data


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Charles Wilson

Corinna Vinschen wrote:

On further looking into this, it appears that the termcap/terminfo
entries are wrong.  ESC O A to ESC O D are only generated after
entering the DEC expanded cursor mode with ESC [ ? 1 h.  The default
codes are ESC [ A to ESC [ D. 



From what I can tell, the "expanded" codes SHOULD be
   ESC [ n A   where n is 1-9, not 0  (and '[' should be there)
and should be emitted when in DECCKM mode.  This stuff is all handled in 
src/command.c but it's a twisty maze that all looks the same.



It's not clear to me why the
termcap/terminfo entries list the expanded mode sequences instead of
the standard sequences.


Referring to my previous message, I don't see that in termcap/terminfo 
at all.  All I see is the correct ESC [ A and friends.


--
Chuck



Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Charles Wilson

Corinna Vinschen wrote:

I'm just a bit puzzled about the key codes.  By default, when rxvt is
invoked without explicitely setting the terminal name (-tn option),
rxvt is recognized as an xterm.


This is a configure option for rxvt (--with-term=) which defaults to 
"xterm".  There are a few differences between rxvt (and 
rxvt-native-cygwin and rxvt-cygwin) and xterm, such as the ACS character 
codes -- and Home, End, Delete, and BackSpace handling.  (Original xterm 
didn't even specify Home/End. Ones newer than ten years do, tho, only 
differently than rxvt).


I've always thought rxvt should report 'rxvt', but since SteveO's 
original version used the default 'xterm' settings, I've never changed 
it.  It *mostly* works in that mode -- and 'xterm' is ALWAYS available 
in /etc/termcap or */terminfo/*, while even the undecorated 'rxvt' might 
be missing.  Like on gentoo-embedded without ncurses-extra-terminfo 
installed.


So, in the absence of -tn, cygwin's rxvt will continue to default to 
'xterm' -- but 'xterm' is NOT a perfect match for rxvt's terminal 
handling, and we shouldn't try to make it so.  If we did, then cygwin's 
rxvt would just be broken on systems that actually HAVE the correct 
(undecorated) 'rxvt' terminfo installed.


However, if it is the list's opinion, I'm willing to be persuaded that 
cygwin's rxvt should default to setting TERM=rxvt in the absence of -tn...



 The cursor keys correctly return
ESC [ A to ESC [ D.  However, the Home and End keys return ESC [ 7 ~
and ESC [ 8 ~, while a real xterm returns ESC [ H and ESC [ F.


From the terminfo.src file, distributed with ncurses, in the 
xterm-color section:


"This description [ed: of xterm-color] is "compatible" with color_xterm, 
rxvt and XFree86 xterm, except that each of those implements the home, 
end, delete keys differently."


So, yeah, here's what terminfo.src says about rxvt-basic:

#   Normal   ShiftControl  Ctrl+Shift
#  Tab  ^I   ESC [ Z  ^I   ESC [ Z
#  BackSpace^H   ^?   ^?   ^?
#  Find ESC [ 1 ~ESC [ 1 $ESC [ 1 ^ESC [ 1 @
#  Insert   ESC [ 2 ~pasteESC [ 2 ^ESC [ 2 @
#  Execute  ESC [ 3 ~ESC [ 3 $ESC [ 3 ^ESC [ 3 @
#  Select   ESC [ 4 ~ESC [ 4 $ESC [ 4 ^ESC [ 4 @
#  PriorESC [ 5 ~scroll-upESC [ 5 ^ESC [ 5 @
#  Next ESC [ 6 ~scroll-down  ESC [ 6 ^ESC [ 6 @
#  Home ESC [ 7 ~ESC [ 7 $ESC [ 7 ^ESC [ 7 @
#  End  ESC [ 8 ~ESC [ 8 $ESC [ 8 ^ESC [ 8 @
#  Delete   ESC [ 3 ~ESC [ 3 $ESC [ 3 ^ESC [ 3 @
#  F1   ESC [ 11 ~   ESC [ 23 ~   ESC [ 11 ^   ESC [ 23 ^
... more function keys ...
#  Up   ESC [ A  ESC [ a  ESC O a  ESC O A
#  Down ESC [ B  ESC [ b  ESC O b  ESC O B
#  RightESC [ C  ESC [ c  ESC O c  ESC O C
#  Left ESC [ D  ESC [ d  ESC O d  ESC O D
#  KP_Enter ^M ESC O M
#  KP_F1ESC O PESC O P
#  KP_F2ESC O QESC O Q
#  KP_F3ESC O RESC O R
#  KP_F4ESC O SESC O S
#  XK_KP_Multiply   *  ESC O j
#  XK_KP_Add+  ESC O k
#  XK_KP_Separator  ,  ESC O l
#  XK_KP_Subtract   -  ESC O m
#  XK_KP_Decimal.  ESC O n
#  XK_KP_Divide /  ESC O o
#  XK_KP_0  0  ESC O p
... more keypad numbers ...


Ok, so I set the terminal to rxvt-cygwin-native as suggested in the
README file.


Frankly, plain old "rxvt" (or rxvt-color, or rxvt-xpm: all three are 
identical) will work just as well.  The only difference between the 
cygwin variants and rxvt is the ACS charset.  And the two cygwin 
variants differ between each other in only ONE character in that charset.



Now the Home and End keys are ok, because the termcap/terminfo entry
for these keys is matching.  However, the termcap/terminfo entries
expect ESC O A to ESC O D for the cursor keys but, as I wrote above,
rxvt returns the xterm sequences ESC [ A to ESC [ D, so the cursor
keys don't work anymore.


I used to have to fix my /etc/termcap. But now the /etc/termcap in 
termcap-20050421-1.tar.bz2 says:


rxvt|rxvt terminal emulator (X Window System):\
:am:eo:km:mi:ms:xn:xo:\
:co#80:it#8:li#24:\
:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
:K1=\EOw:K2=\EOu:K3=\EOy:K4=\EOq:K5=\EOs:LE=\E[%dD:\
:RI=\E[%dC:UP=\E[%dA:ae=^O:al=\E[L:as=^N:bl=^G:cd=\E[J:\
:ce=\E[K:c

Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Charles Wilson

Brian Dessent wrote:

Corinna Vinschen wrote:


as before.  I'm going to use this patch locally anyway, but maybe that's
one for inclusion upstream?


As far as I know, there is no upstream rxvt -- it's a dead project.  The
rxvt-unicode fork is where new development happens.  I'm not sure what
that means exactly for the W11/Win32 parts of rxvt.  I'm sure Chuck
could answer this a lot more definitively.


Brian's right: upstream rxvt is dead, and rxvt-unicode is where the 
action is.  However, rxvt-unicode does not (yet) have any mechanism for 
non-X11 operation, so I'll keep cygwin's rxvt going.


More downthread.

--
Chuck



Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Corinna Vinschen
On Aug 20 16:44, Corinna Vinschen wrote:
> On Aug 20 16:06, Corinna Vinschen wrote:
> > I'm just a bit puzzled about the key codes.  By default, when rxvt is
> > invoked without explicitely setting the terminal name (-tn option),
> > rxvt is recognized as an xterm.  The cursor keys correctly return
> > ESC [ A to ESC [ D.  However, the Home and End keys return ESC [ 7 ~
> > and ESC [ 8 ~, while a real xterm returns ESC [ H and ESC [ F.
> > 
> > Ok, so I set the terminal to rxvt-cygwin-native as suggested in the
> > README file.
> > 
> > Now the Home and End keys are ok, because the termcap/terminfo entry
> > for these keys is matching.  However, the termcap/terminfo entries
> > expect ESC O A to ESC O D for the cursor keys but, as I wrote above,
> > rxvt returns the xterm sequences ESC [ A to ESC [ D, so the cursor
> > keys don't work anymore.
> 
> On further looking into this, it appears that the termcap/terminfo
> entries are wrong.  ESC O A to ESC O D are only generated after
> entering the DEC expanded cursor mode with ESC [ ? 1 h.  The default
> codes are ESC [ A to ESC [ D.  It's not clear to me why the
> termcap/terminfo entries list the expanded mode sequences instead of
> the standard sequences.

I'd like to suggest the below patch.  It aligns the handling of
Home and End key to its xterm counterparts.  That doesn't solve the
problem with the rxvt-cygwin-native termcap/terminfo entries, but it
let rxvt work better in default xterm mode.  Home and End now generate
the vt102/vt220/xterm sequence ESC [ H and ESC [ F.  After switching
to the DEC extended cursor mode, they generate ESC O H and ESC O F,
same as vt102/vt220/xterm.


Corinna


--- command.c.ORIG  2007-08-20 16:51:43.419482700 +0200
+++ command.c   2007-08-20 16:55:20.632170700 +0200
@@ -465,6 +465,8 @@ rxvt_lookup_key(rxvt_t *r, XKeyEvent *ev
 #endif
case XK_End:
STRCPY(kbuf, KS_END);
+   if (r->h->PrivateModes & PrivMode_aplCUR)
+ kbuf[1] = 'O';
break;
 #ifdef XK_KP_Home
case XK_KP_Home:
@@ -477,6 +479,8 @@ rxvt_lookup_key(rxvt_t *r, XKeyEvent *ev
 #endif
case XK_Home:
STRCPY(kbuf, KS_HOME);
+   if (r->h->PrivateModes & PrivMode_aplCUR)
+ kbuf[1] = 'O';
break;
 
 #define FKEY(n, fkey)  \
--- command.h.ORIG  2007-08-20 16:56:10.099082700 +0200
+++ command.h   2007-08-20 16:56:20.687946700 +0200
@@ -38,8 +38,8 @@
 # define KS_HOME   "\033[1~"   /* Home == Find */
 # define KS_END"\033[4~"   /* End == Select */
 #else
-# define KS_HOME   "\033[7~"   /* Home */
-# define KS_END"\033[8~"   /* End */
+# define KS_HOME   "\033[H"/* Home */
+# define KS_END"\033[F"/* End */
 #endif
 
 #ifdef SCROLL_ON_SHIFT

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Corinna Vinschen
On Aug 20 16:06, Corinna Vinschen wrote:
> I'm just a bit puzzled about the key codes.  By default, when rxvt is
> invoked without explicitely setting the terminal name (-tn option),
> rxvt is recognized as an xterm.  The cursor keys correctly return
> ESC [ A to ESC [ D.  However, the Home and End keys return ESC [ 7 ~
> and ESC [ 8 ~, while a real xterm returns ESC [ H and ESC [ F.
> 
> Ok, so I set the terminal to rxvt-cygwin-native as suggested in the
> README file.
> 
> Now the Home and End keys are ok, because the termcap/terminfo entry
> for these keys is matching.  However, the termcap/terminfo entries
> expect ESC O A to ESC O D for the cursor keys but, as I wrote above,
> rxvt returns the xterm sequences ESC [ A to ESC [ D, so the cursor
> keys don't work anymore.

On further looking into this, it appears that the termcap/terminfo
entries are wrong.  ESC O A to ESC O D are only generated after
entering the DEC expanded cursor mode with ESC [ ? 1 h.  The default
codes are ESC [ A to ESC [ D.  It's not clear to me why the
termcap/terminfo entries list the expanded mode sequences instead of
the standard sequences.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Corinna Vinschen
On Aug 20 13:59, Corinna Vinschen wrote:
> On Aug 20 04:25, Brian Dessent wrote:
> > Corinna Vinschen wrote:
> > 
> > > as before.  I'm going to use this patch locally anyway, but maybe that's
> > > one for inclusion upstream?
> > 
> > As far as I know, there is no upstream rxvt -- it's a dead project.  The
> > rxvt-unicode fork is where new development happens.  I'm not sure what
> > that means exactly for the W11/Win32 parts of rxvt.  I'm sure Chuck
> > could answer this a lot more definitively.
> 
> It makes still sense for Cygwin, isn't it?

I'm just a bit puzzled about the key codes.  By default, when rxvt is
invoked without explicitely setting the terminal name (-tn option),
rxvt is recognized as an xterm.  The cursor keys correctly return
ESC [ A to ESC [ D.  However, the Home and End keys return ESC [ 7 ~
and ESC [ 8 ~, while a real xterm returns ESC [ H and ESC [ F.

Ok, so I set the terminal to rxvt-cygwin-native as suggested in the
README file.

Now the Home and End keys are ok, because the termcap/terminfo entry
for these keys is matching.  However, the termcap/terminfo entries
expect ESC O A to ESC O D for the cursor keys but, as I wrote above,
rxvt returns the xterm sequences ESC [ A to ESC [ D, so the cursor
keys don't work anymore.

So the question is, how is that supposed to work?  Wouldn't it make
sense to change the escape sequences of Home and End key to their xterm
equivalents and drop the idea to set TERM to rxvt-cygwin-native?
At least this looks like the simpler approach, rather than changing
the termcap/terminfo entries of the world...


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Corinna Vinschen
On Aug 20 04:25, Brian Dessent wrote:
> Corinna Vinschen wrote:
> 
> > as before.  I'm going to use this patch locally anyway, but maybe that's
> > one for inclusion upstream?
> 
> As far as I know, there is no upstream rxvt -- it's a dead project.  The
> rxvt-unicode fork is where new development happens.  I'm not sure what
> that means exactly for the W11/Win32 parts of rxvt.  I'm sure Chuck
> could answer this a lot more definitively.

It makes still sense for Cygwin, isn't it?


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Brian Dessent
Corinna Vinschen wrote:

> as before.  I'm going to use this patch locally anyway, but maybe that's
> one for inclusion upstream?

As far as I know, there is no upstream rxvt -- it's a dead project.  The
rxvt-unicode fork is where new development happens.  I'm not sure what
that means exactly for the W11/Win32 parts of rxvt.  I'm sure Chuck
could answer this a lot more definitively.

Brian


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Corinna Vinschen
On Aug 19 13:08, Charles Wilson wrote:
> Corinna Vinschen wrote:
> >OTOH, if you have an idea how to solve the ALT + Cursor key problem
> 
> No, nothing obvious. I'd just turn on some of the debugging in the main 
> loop and see what happens to the keystrokes.

Got it.  The Alt key is handled rather strange in Windows.  For some
reason, some of the Alt-key combinations generate a WM_SYSCHAR message,
while other Alt-key combinations (Alt-Cursor, Alt-Fkey, etc) generate a
WM_SYSKEYDOWN message only. 

rxvt already handles *one* *single* *key* *combination* specially,
Alt-F10.  I have no idea what's so special with Alt-F10, but there you
are.  This special handling is not necessary, it even looks a bit wrong.

The patch to get all missing Alt-key combinations working is quite
simple:

--- W11/w32/event.c.ORIG2007-08-20 12:56:25.637210400 +0200
+++ W11/w32/event.c 2007-08-20 13:09:55.322732400 +0200
@@ -127,11 +127,6 @@ doTranslateMessage(MSG *m)
((m->wParam == VK_BACK) ||
 (((m->wParam == VK_ADD) || (m->wParam == VK_SUBTRACT)) &&
  (GetKeyState(VK_SHIFT) & 0x8000 return;
-   if ((m->message == WM_SYSKEYDOWN) && (m->wParam == VK_F10))
-   {
-   m->message = WM_KEYDOWN;
-   return;
-   }
TranslateMessage(m);
 }
 
@@ -205,7 +200,8 @@ LONG NT_handleMsg(
case WM_QUIT:
case WM_CLOSE:
case WM_DESTROY:
-   case WM_SYSCHAR:/* alt-keys go here */
+   case WM_SYSKEYDOWN: /* Some alt-keys go here */
+   case WM_SYSCHAR:/* Other alt-keys go here */
case WM_CHAR:
case WM_LBUTTONDBLCLK:
case WM_MBUTTONDBLCLK:
@@ -543,6 +539,7 @@ WinEventToXEvent(
}
event->xkey.window=(Window)window;
break;
+   case WM_SYSKEYDOWN:
case WM_KEYDOWN:
event->type=KeyPress;
switch (wParam)

This works fine for me.  All other, already working Alt-key combinations
still work, plus the new Alt-Cursor, Alt_Fkey, etc.  Even Alt-F10 works
as before.  I'm going to use this patch locally anyway, but maybe that's
one for inclusion upstream?


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-19 Thread Charles Wilson

Corinna Vinschen wrote:

neither recognize Alt + Cursor, nor Ctrl + Cursor keys for me.

^
scratch that, I was confused.


I misinterpreted -- after seeing this message, I thought you had solved 
the problem entirely.  I haven't read the mailing list messages today 
yet, so I missed the stuff below...



As vi user I'm not a real emacs person.  I'm using the cursor keys a lot
in tcsh, especially to scroll through the history, so it's quite helpful
to do all moving using the cursor keys in tcsh, imho.

In the meantime I found that Cygwin's rxvt when running under X *does*
recognize ALT + Cursor keys, and the escape codes are identical to rxvt
under Linux.

So, the question is this: Why does rxvt not recognize ALT + Cursor keys
in Cygwin in native Windows mode?


I was going to look for this problem myself, but I'm not able to build
rxvt from source:

  $ cygport rxvt-20050409-4 compile
  [...]
   gcc -DHAVE_CONFIG_H -DHAVE_LIBXPM -O2 -pipe -DDEBUG_STRICT 
-I/home/corinna/src/rxvt/rxvt-20050409-4/build/W11/X11 
-I/home/corinna/src/rxvt/rxvt-20050409-4/build/W11 -I.. 
-I/home/corinna/src/rxvt/rxvt-20050409-4/src/rxvt/src -I. -c command.c -o 
command.o
  In file included from command.c:49:
  rxvt.h:58:19: xpm.h: No such file or directory
  [...]

The file /usr/include/X11/xpm.h is present on my system, there's no
special xpm.h in the rxvt sources.

What am I doing wrong?  Is it some sort of build dependency I'm missing?


Yes -- you need a patched cygport.  The official cygport is still 
missing some of my patches from ten months ago.  I'll send an updated 
version of cygport in a private message.



OTOH, if you have an idea how to solve the ALT + Cursor key problem


No, nothing obvious. I'd just turn on some of the debugging in the main 
loop and see what happens to the keystrokes.


--
Chuck


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-19 Thread Corinna Vinschen
Charles,

On Aug 19 09:43, Corinna Vinschen wrote:
> On Aug 18 12:27, Andrew DeFaria wrote:
> > Corinna Vinschen wrote:
> > 
> > >On Aug 18 10:50, Corinna Vinschen wrote:
> > >>It just doesn't work for a Cygwin rxvt window. For some reason it does
> > >>neither recognize Alt + Cursor, nor Ctrl + Cursor keys for me.
> > >^
> > >scratch that, I was confused.
> > >
> > >Corinna
> > A real emacs person would use Alt-F (forward-word) and Alt-B (backward 
> > word). ;-)
> 
> As vi user I'm not a real emacs person.  I'm using the cursor keys a lot
> in tcsh, especially to scroll through the history, so it's quite helpful
> to do all moving using the cursor keys in tcsh, imho.
> 
> In the meantime I found that Cygwin's rxvt when running under X *does*
> recognize ALT + Cursor keys, and the escape codes are identical to rxvt
> under Linux.
> 
> So, the question is this: Why does rxvt not recognize ALT + Cursor keys
> in Cygwin in native Windows mode?

I was going to look for this problem myself, but I'm not able to build
rxvt from source:

  $ cygport rxvt-20050409-4 compile
  [...]
   gcc -DHAVE_CONFIG_H -DHAVE_LIBXPM -O2 -pipe -DDEBUG_STRICT 
-I/home/corinna/src/rxvt/rxvt-20050409-4/build/W11/X11 
-I/home/corinna/src/rxvt/rxvt-20050409-4/build/W11 -I.. 
-I/home/corinna/src/rxvt/rxvt-20050409-4/src/rxvt/src -I. -c command.c -o 
command.o
  In file included from command.c:49:
  rxvt.h:58:19: xpm.h: No such file or directory
  [...]

The file /usr/include/X11/xpm.h is present on my system, there's no
special xpm.h in the rxvt sources.

What am I doing wrong?  Is it some sort of build dependency I'm missing?

OTOH, if you have an idea how to solve the ALT + Cursor key problem


Thanks,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat