From owner-freebsd-bugs@FreeBSD.ORG Mon Nov 29 05:36:36 2010 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E153106566B for ; Mon, 29 Nov 2010 05:36:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id E0FD38FC08 for ; Mon, 29 Nov 2010 05:36:35 +0000 (UTC) Received: from c122-106-145-124.carlnfd1.nsw.optusnet.com.au (c122-106-145-124.carlnfd1.nsw.optusnet.com.au [122.106.145.124]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id oAT5aVI6026814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 29 Nov 2010 16:36:33 +1100 Date: Mon, 29 Nov 2010 16:36:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker In-Reply-To: <201011211540.oALFeBkA006865@freefall.freebsd.org> Message-ID: <20101129155432.M2824@besplex.bde.org> References: <201011211540.oALFeBkA006865@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-bugs@FreeBSD.org Subject: Re: kern/152162: [syscons] On syscons, pressing delete key results in pressing backspace. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2010 05:36:36 -0000 On Sun, 21 Nov 2010, Jilles Tjoelker wrote: > With the new "libteken" terminal emulator code in 9-current, syscons is > now much like xterm. It appears that Backspace is still ^H, but Delete > is now ^[[3~ instead of ^?. That is a bug, but libteken in syscons mode doesn't have it. Termios only supports single characters as special characters, so mapping any key to multiple characters breaks its use as a special character for normal POSIX terminal input. Loss of the special character ASCII DEL would be especially large breakage since it is in common use as a special character. Some key should be mapped to it, and the old choice of the Delete key is best. Perhaps termios can support wide characters or encoded characters for termios (cc_t can be any integral type), but I've never seen that done, and cc_t is just unsigned char in FreeBSD. > A while ago, I changed 9-current libedit (and therefore programs like sh > and ftp) to recognize ^[[3~. I encourage you to ask tcsh upstream to fix > this as well (either by hardcoding ^[[3~ somewhere or by using the > appropriate termcap/terminfo field). Editors not using normal terminal input can do this. Some intentionally put the keyboard in a special mode in which the keys return longer, unique escape sequences so that they be reassigned. I couldn't find the standard termcap variable for this, but found the interesting variables S4 and S5 which switch between normal keyboard mode and "PC scancode mode" for SVr4 on PCs. > Making the Backspace key send ^? may be slightly dangerous as it is > rather annoying if Backspace does Delete (more annoying than Delete > doing Backspace, IMHO). On the other hand, vte-based terminal programs > such as gnome-terminal and xfce4's Terminal send ^? by default and it > seems to work fine. ASCII DEL is still the default for VERASE. Anyone still using that would expect Delete to work as Backspace and be very annoyed if Delete started returning CSI 3 ~. IIRC, the first U[^H|^?]Xenix system that I used had this (DEL for VERASE), and perhaps also ASCII Backspace for VINTR. Or it may just have had DEL for VINTR. Certainly not the ^C for VINTR that I was used to. This took some getting used to. After a while I learned to use stty to map Backspace and ^C "normally" and now rarely use Delete/DEL. Bruce