From owner-freebsd-questions@FreeBSD.ORG Thu Feb 14 19:20:02 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D59416A41A for ; Thu, 14 Feb 2008 19:20:02 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from betty.computinginnovations.com (mail.computinginnovations.com [64.81.227.250]) by mx1.freebsd.org (Postfix) with ESMTP id 1421413C457 for ; Thu, 14 Feb 2008 19:20:01 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from p28.computinginnovations.com (dhcp-10-20-30-100.computinginnovations.com [10.20.30.100]) (authenticated bits=0) by betty.computinginnovations.com (8.14.2/8.13.8) with ESMTP id m1EJJdAW066010; Thu, 14 Feb 2008 13:19:40 -0600 (CST) (envelope-from derek@computinginnovations.com) Message-Id: <6.0.0.22.2.20080214125433.0249bcb0@mail.computinginnovations.com> X-Sender: derek@mail.computinginnovations.com X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22 Date: Thu, 14 Feb 2008 13:19:32 -0600 To: Martin Cracauer , freebsd-questions@freebsd.org From: Derek Ragona In-Reply-To: <20080214180644.GA95722@cons.org> References: <20080214180644.GA95722@cons.org> Mime-Version: 1.0 X-ComputingInnovations-MailScanner-Information: Please contact the ISP for more information X-ComputingInnovations-MailScanner: Found to be clean X-ComputingInnovations-MailScanner-From: derek@computinginnovations.com X-Spam-Status: No Content-Type: text/plain; charset="us-ascii"; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: Curses problem with keymapping in screen and debugging curses X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Feb 2008 19:20:02 -0000 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.