From owner-freebsd-questions Thu Mar 1 1: 7: 0 2001 Delivered-To: freebsd-questions@freebsd.org Received: from ins-gw.eu.csc.com (mailgw.europe.csc.com [194.205.83.246]) by hub.freebsd.org (Postfix) with SMTP id 2E6FF37B71B; Thu, 1 Mar 2001 01:06:49 -0800 (PST) (envelope-from mgraaf@csc.com) Received: by ins-gw.eu.csc.com (SMI-8.6/SMI-SVR4) id JAA21658; Thu, 1 Mar 2001 09:05:16 GMT Received: from unknown (20.9.148.45) by CSCgw. ID xaia21254; Thu, 1 Mar 01 09:04:50 GMT Received: from uk-fbr10.eu.csc.com ([20.9.148.36]) by uk-mdsrelay.eu.csc.com (Lotus Domino Release 5.0.4a) with ESMTP id 2001030109045876:1939 ; Thu, 1 Mar 2001 09:04:58 +0000 Subject: Re: strangeness with xterm To: questions@FreeBsd.org Cc: stable@FreeBsd.org From: "Meino de Graaf" Date: Thu, 1 Mar 2001 10:03:08 +0100 Message-ID: MIME-Version: 1.0 X-MIMETrack: Serialize by Router on UK-FBR10/UK/CSC(Release 5.0.4a |July 24, 2000) at 01/03/2001 09:05:00 AM, Itemize by SMTP Server on DOMRELAY/UK-MDSRELAY(Release 5.0.4a |July 24, 2000) at 01/03/2001 09:04:58 AM, Serialize by Router on DOMRELAY/UK-MDSRELAY(Release 5.0.4a |July 24, 2000) at 01/03/2001 09:05:31 AM, Serialize complete at 01/03/2001 09:05:31 AM Content-type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is not a new or strange behavior. As long I have worked with UNIX boxes (early 80s) this behavior has been present in UNIX systems. BTW it is not related to xterm. When I used VT100 terminals on serial lines, this behavior existed already. The deeper cause of this behavior has to do with the following: - Special keys (function keys, arrows etc) generate a sequence of characters, FE an arrow up generates esc[A. - The communication (Serial or TCP/IP) is character based, so the above mentioned character sequence does not arive as a single packet. - The kernel delivers all the characters it has available at the moment a process does a read on a tty file descriptor. This means that if the above sequence is not yet fully received, the kernel will deliver what it has, say the esc had already arrived, so curses (what vi uses) receives an escape character without the following two characters. - Curses tries to match the received data with its termio or termcap files and when found it returns that function. If no matching capability is found it passes the read data (the esc) unmodified to the process (vi). Therefore if due to timing the above sequence got split up, vi will receive first a standalone esc character followed by the '[' & 'A' character. So I also never use these special functions in vi and use the hjkl keys for navigation. Meino de Graaf CSC Integrated Payments ---------------------- Forwarded by Meino de Graaf/BEN/CSC on 03/01/2001 10:04 AM --------------------------- Marius @FreeBSD.ORG on 02/28/2001 07:16:57 PM Sent by: owner-freebsd-stable@FreeBSD.ORG To: questions@FreeBSD.org cc: stable@freeBSD.org Subject: Re: strangeness with xterm I get this behavior when I am using ssh from my FreeBSD box to our Sun servers. It 'feels' like when I am using the arrow keys to move around quickly that somethings gets mangled and the wrong key sequence gets played out as my input. I can usually use my arrow keys in vi, but when I try to scroll up or down very quickly, I can consistantly reproduce this error. Jumping to one of our production linux/BSD boxes behind the Sun server and vi works consitantly. I assumed it was some kind of terminal setting incompatability that could be rooted out, but again that is just a whim. I mainly just force myself to use the hjkl keys... -------------------- Marius Community Connect Inc On Wed, 28 Feb 2001, Kal Torak wrote: > Lanny Baron wrote: > > > > Hello Fellow FreeBSD'ers, > > Since an installation or rather an upgrade to 4.2-STABLE, I have been > > encountering problems with X using xterm's. The problem demonstrates itself > > when editing files with vi and even when installing apps like mod_php4. It > > seems to be linked to the up and down scrolling keys. When scrolling up, many > > times vi goes into insert mode and puts in an A and when scrolling down, it > > will put in B's and C's. Addtiionally, the number pad keys will not input > > numbers but rather letters. > > > > Has anyone else had this problem? Would anyone know how to correct the > > symptom? > > > It has something to do with how the xterm is interpreting those keys... > You get the same sort of behavior when telneting from windows etc. > > The shell understands them but not vi and others... I would like to > know how to correct this as well... > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-stable" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message