From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12900 invoked from network); 19 Jan 2005 13:14:04 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 19 Jan 2005 13:14:04 -0000 Received: (qmail 70930 invoked from network); 19 Jan 2005 13:13:58 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Jan 2005 13:13:58 -0000 Received: (qmail 877 invoked by alias); 19 Jan 2005 13:13:31 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8397 Received: (qmail 862 invoked from network); 19 Jan 2005 13:13:30 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 19 Jan 2005 13:13:30 -0000 Received: (qmail 69423 invoked from network); 19 Jan 2005 13:12:50 -0000 Received: from main.gmane.org (80.91.229.2) by a.mx.sunsite.dk with SMTP; 19 Jan 2005 13:12:48 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CrFdd-00077c-00 for ; Wed, 19 Jan 2005 14:12:45 +0100 Received: from ppp154-51.lns1.mel3.internode.on.net ([150.101.154.51]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Jan 2005 14:12:45 +0100 Received: from boyd-adamson by ppp154-51.lns1.mel3.internode.on.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 19 Jan 2005 14:12:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@sunsite.dk From: Boyd Adamson Subject: The old backspace/delete problem Date: Thu, 20 Jan 2005 00:12:32 +1100 Message-ID: <87ekghftq7.fsf@eddy.tactio.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: ppp154-51.lns1.mel3.internode.on.net User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:qD7d1uoT9dXzUf2yg7PgFs+GuIM= Sender: news X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Someone recently mentioned to me a solution to the old "backspace key sends ^? or ^H" problem that I hadn't heard of, and I thought we here in zsh land might be able to improve on it. The solution I saw was for a ksh user: alias ^?='stty erase ^?' alias ^H='stty erase ^H' The idea is that on login, the user types . This will do one of two things: 1. The character sent by the backspace key will match the current tty setting. In this case nothing happens except for a new prompt, or, 2. The character sent by the backspace key does not match the current tty setting, the alias is expanded and the tty setting is changed to match the terminal emulator. Now this is nice, but it doesn't help those of use who use a superior shell, since both ^? and ^H are normally mapped to the same function (something like backward-delete-char). This is nice in the shell, but potentially leaves us with a broken backspace key in other command line programs. Any ideas on how we could do this sort of auto-detection in zsh? What about the ability to automatically do the stty stuff the first time we receive a ^H or ^?, even in the middle of the command? Something like this: $ cd /usr/liv causes stty erase to be run in the background and then backward-delete-char - and after that fall back to the normal behavior. Any thoughts? Is this just crazy? Or has it been done before? Boyd