From owner-freebsd-questions Thu Mar 1 1:17: 9 2001 Delivered-To: freebsd-questions@freebsd.org Received: from www.golsyd.net.au (ftp.golsyd.net.au [203.57.20.1]) by hub.freebsd.org (Postfix) with ESMTP id 842EF37B71A; Thu, 1 Mar 2001 01:17:05 -0800 (PST) (envelope-from kaltorak@quake.com.au) Received: from [203.164.12.28] by www.quake.com.au (NTMail 4.30.0012/AB6169.63.5724aadf) with ESMTP id mpjaaaaa for ; Thu, 1 Mar 2001 20:17:03 +1100 Message-ID: <3A9E13FD.8BBBFAE0@quake.com.au> Date: Thu, 01 Mar 2001 20:18:53 +1100 From: Kal Torak X-Mailer: Mozilla 4.73 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Meino de Graaf Cc: questions@FreeBsd.org, stable@FreeBsd.org Subject: Re: strangeness with xterm References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Meino de Graaf wrote: > > 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. That makes sense and all.. But is there anyway to fix it? Because I have never had this problem with FreeBSD telnet, only with windows... Also it seems to happen more on my local network than when connecting to a remote network, very strange since it should be faster and therefore get all the characters? Also I have only ever noticed this with vi... Shells like bash etc, seem to get the characters perfectly... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message