Curses problem with keymapping in screen and debugging curses

2008-02-14 Thread Martin Cracauer
I have the following problem when using screen sessions between
FreeBSD and Linux:

The pageup/pagedown keys stop working when I re-attach a session that
was started under FreeBSD to a console that is Linux driven and vice
versa.  All other keys, including alt/meta and some supposedly more
complicated keys continue to work.  I haven't verified this in detail
but it seems that while programs like mutt seem affected often emacs
seems to be happy.

I know NIL about curses.  How would I go about debugging this? I would
need something like xev for curses to see what keys I get from the
different consoles and then I'd need something to find out what a
given session expects.

Where do I start looking?

Also, I see screen on FreeBSD emit line noise on a regular basis, both
when attaching before the session comes up and after deattaching.
Dunno whether this helps.  Example:
# session running, press detach key
[detached]
-en \033]0; grisu:ttype:~\007

Martin
-- 
%%%
Martin Cracauer [EMAIL PROTECTED]   http://www.cons.org/cracauer/
FreeBSD - where you want to go, today.  http://www.freebsd.org/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Curses problem with keymapping in screen and debugging curses

2008-02-14 Thread Derek Ragona

At 12:06 PM 2/14/2008, Martin Cracauer wrote:

I have the following problem when using screen sessions between
FreeBSD and Linux:

The pageup/pagedown keys stop working when I re-attach a session that
was started under FreeBSD to a console that is Linux driven and vice
versa.  All other keys, including alt/meta and some supposedly more
complicated keys continue to work.  I haven't verified this in detail
but it seems that while programs like mutt seem affected often emacs
seems to be happy.

I know NIL about curses.  How would I go about debugging this? I would
need something like xev for curses to see what keys I get from the
different consoles and then I'd need something to find out what a
given session expects.

Where do I start looking?

Also, I see screen on FreeBSD emit line noise on a regular basis, both
when attaching before the session comes up and after deattaching.
Dunno whether this helps.  Example:
# session running, press detach key
[detached]
-en \033]0; grisu:ttype:~\007

Martin


Martin,

In the past I have had issues with reading some keys with curses too.

I would read the keys and if they were unknown I'd print out the value.  I 
used a large case statement and if the key fell through I printed out the 
value.


You also need to remember in curses most of the extra keys, function and 
movement keys are compound sequences where first ESC is sent, then the 
actual keycode is in the next two bytes.  You have to get those two bytes 
and put them together to decode the actual keycode.


You can debug your program in any debugger, I used xxgdb from the ports.

-Derek


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]