From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from math.gatech.edu (euclid.skiles.gatech.edu [130.207.146.50]) by werple.net.au (8.7/8.7.1) with SMTP id AAA08686 for ; Thu, 23 Nov 1995 00:42:58 +1100 (EST) Received: by math.gatech.edu (5.x/SMI-SVR4) id AA18869; Wed, 22 Nov 1995 08:12:57 -0500 Resent-Date: Wed, 22 Nov 1995 13:13:10 +0000 (GMT) Old-Return-Path: From: Zefram Message-Id: <5178.199511221313@stone.dcs.warwick.ac.uk> Subject: Re: beta12: 8-bit-cleanliness To: P.Stephenson@swansea.ac.uk Date: Wed, 22 Nov 1995 13:13:10 +0000 (GMT) Cc: zsh-workers@math.gatech.edu In-Reply-To: <22090.9511220933@pygmy.swan.ac.uk> from "P.Stephenson@swansea.ac.uk" at Nov 22, 95 09:33:00 am X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]6632.75 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-Id: <"90WDu2.0.ic4.O7oim"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/634 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu >hmm.. looks to me like the correct thing is appearing in the history, >it's just getting messed up on print out. There's a routine called >nicefputs() which formats history lines for display: it does an >isprint() check on each character. This returns false for printable >8-bit characters. Now, the shell doesn't know whether the terminal >can print 8-bit characters or not. But that's not the full problem, >since for characters over 128 which it doesn't think are printable, it >just strips off 0x40 and prints it anyway. Odd, I would have thought isprint() would get it right. >Here's my suggestion: assume we can print 8-bit chars, but handle >anything in the range of control characters + 128 separately by >sticking \M- in front. (They're likely to get messed up inside zsh >anyway; one day they might work, though.) The following is about the >best we can easily do. That's a good solution. When I modified nicefputs() etc. recently I deliberately didn't bother handling 8-bit characters, because zsh isn't 8-bit clean. I would rather have a proper fix, recognising which characters are *really* printable, but this is a reasonable solution for unprintable characters. You'll want to modify nicestrlen() as well. -zefram