[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: keypad doesn't work in rxvt



scratch wrote:

> Wow. That is what I call an explanation. Thanks.
>
> I've tried to do some more digging up myself, although I don't fully
> understand everything you say. I've found that the rxvt terminfo entries
> are supplied by the libncurses-base packages, so maybe a bug report
> against that should be done.
>
> intra:/usr/share/terminfo/r# dpkg -S /usr/share/terminfo/r/rxvt*
> ncurses-base: /usr/share/terminfo/r/rxvt
> ncurses-term: /usr/share/terminfo/r/rxvt-basic
> ncurses-base: /usr/share/terminfo/r/rxvt-m
> ncurses-term: /usr/share/terminfo/r/rxvt-orig
> intra:/usr/share/terminfo/r# dpkg -S /etc/terminfo/r/rxvt*
> ncurses-base: /etc/terminfo/r/rxvt
> ncurses-base: /etc/terminfo/r/rxvt-m
>
> rxvt & rxvt-m in /usr/share are symlinks to the /etc ones.
>
> Now, about the control sequences stuff. Doing infocmp rxvt gives doesn't
> give me an "is1" entry.
>
> intra:~# infocmp rxvt | egrep '33'
>         kf18=\E[32~, kf19=\E[33~, kf2=\E[12~, kf20=\E[34~,

Oh, you should do:

infocmp rxvt | grep is1

I'm sorry to confuse you with the \033 stuff. In the infocmp output it puts \E to mean the
character with the octal value 033 (escape character), which I was also writing as \033
since that's what you pass to echo -e to get it to print the escape character.

> The only place with Escape 33 seems to be "kf19". What I'm confused with,
> is what these sequences are used for, and more importantly *when* they're
> executed (for example what is executed when I start up rxvt). Maybe it
> would be a good thing if you could send me that manual :).
>
> Am I right when I think that, to solve my problem, I have to edit the rxvt
> terminfo file? Should I add Escape-33 to a specific control sequence? I'm
> still confused, although you've cleared up quite some issues over here :)

Yeah, I guess you could could recreate the the terminfo file to fix this. I actually tried
this and it actually didn't have any effect. 8( Perhaps the terminal initialization sequence
isn't written to it at all. I guess you just put to use tput reset or something like that in
your .bash_profile. This would seem to be a bug with rxvt. Anyway here's what I did you fix
the terminfo database:

infocmp rxvt | sed -e '/is1=/ s/\\E=/\\E>/' > rxvt.info
tic rxvt.info

I wish it would've fixed it!

>
> Thanks,
>
> -- nico
>
> On Wed, 12 May 1999, Jens B. Jorgensen wrote:
>
> > That is odd that the terminal isn't "reset" when rxvt starts up. You can get the same
> > behavior (keypad works) with:
> >
> > tput reset
> >
> >     -or-
> >
> > echo -ne '\033>'
> >
> > "Ah ha!" you say, so this '\033>' sequence is what does it, but what the hell is
> > '\033>'? Well, if you look at the Xterm Control Sequences document it sez:
> >
> > ESC =          Application Keypad (DECPAM)
> > ESC >          Normal Keypad (DECPNM)
> >
> > So in fact if you do:
> >
> > echo -en '\033='
> >
> > Then your keypad will cease to work again. Cool eh? So why does reset and 'tput reset'
> > do this? Weeelllll, (as the man page for tput will tell you) doing a 'reset' causes
> > the rs1, rs2, rs3 and rf terminal control sequences to be written to the terminal. We
> > use the infocmp program to print out our terminal settings:
> >
> > chilin$ infocmp | egrep '(rs1|rs2|rs3|rf)='
> >         rs1=\E>\E[1;3;4;5;6l\E[?7h\E[m\E[r\E[2J\E[H,
> >         rs2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E>,
> >
> > So that's the first thing. Now we're on the trail. When the terminal is 'init'ialized
> > (as per tput, which must be what happens when rxvt starts up) the terminals is1, is2,
> > is3, if and iprog strings are output to the terminal (if present). A look again at our
> > infocmp output shows:
> >
> > chilin$ infocmp | egrep '(is1|is2|is3|if)='
> >         ind=^J, is1=\E[?47l\E=\E[?1l,
> >         is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l,
> >
> > You can see that is1 does a '\033=' (\E == Escape == \033). Hmm. I guess if the rxvt
> > used to work with the keypad before "out of the box" what's happened is that the
> > debian-dude in charge of terminfo entries changed the entries and that's why the
> > behavior changed. If you'd like the Xterm Control Sequences doc, I think it comes with
> > the xbooks package. If you don't want to download the whole (20MB or so) xbooks
> > package email me and I'll send it to you.
> >
> > Now, what is going to the keyboard when it's in "Application" mode and you type
> > <keypad 4>? Well, it's '\033Ot'. Why? I don't know! I can tell you that when I type
> > the other left-arrow key I get '\033[D' which infocmp happily tells me is the kcub1
> > (aka kl, or key-left) sequence. Hmmm, curiouser and curiouser. It seems to me that the
> > keypad 4 should at least generate the key-left sequence if not the 4, right?! I have
> > no idea why it generates '\033Ot' especially since this doesn't seem to be any
> > sequence infocmp knows about.
>
> --nico
>
> --:: Nico Galoppo ::--------------------------------------------------
> --:: scratch at ace.ulyssis.student.kuleuven.ac.be ::-----------------
>   ::                                               ::
> --:::::::::::::::::::::::::: Linux - Free power for the masses :::::::

--
Jens B. Jorgensen
jjorgens@bdsinc.com



Reply to: