From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26029 invoked from network); 11 Oct 2004 22:12:45 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Oct 2004 22:12:45 -0000 Received: (qmail 76848 invoked from network); 11 Oct 2004 22:12:39 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Oct 2004 22:12:39 -0000 Received: (qmail 7315 invoked by alias); 11 Oct 2004 22:12:36 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20470 Received: (qmail 7301 invoked from network); 11 Oct 2004 22:12:34 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 Oct 2004 22:12:34 -0000 Received: (qmail 76104 invoked from network); 11 Oct 2004 22:11:53 -0000 Received: from moonbase.zanshin.com (64.84.47.139) by a.mx.sunsite.dk with SMTP; 11 Oct 2004 22:11:50 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.13.1/8.13.1) with ESMTP id i9BMBhTS021709; Mon, 11 Oct 2004 15:11:44 -0700 Date: Mon, 11 Oct 2004 15:11:43 -0700 (PDT) From: Bart Schaefer Reply-To: zsh-workers@sunsite.dk To: zsh-workers@sunsite.dk cc: Jordan Breeding Subject: Re: prompt and prompt_cr option In-Reply-To: <546D60C2-1A06-11D9-B624-000A95A6C222@mac.com> Message-ID: References: <546D60C2-1A06-11D9-B624-000A95A6C222@mac.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Sat, 9 Oct 2004, Jordan Breeding wrote: > Is there a way to force zsh to check to see if the last character that > was printed was a newline and if it wasn't to just print one before it > issues the carriage return? No. There's no way, in general, for zsh to know what characters were previously output to the terminal (or for any process to know what any other process has done with a shared device). For certain types of terminals you might be able to query the current cursor position and do something clever when it is not in column zero, but it's been deemed more trouble than it's worth to have ZLE attempt to determine whether the terminal has support for this and then to make use of that information. (Querying the terminal involves sending a control string and then reading back a response, which is unreliable because it can be garbled by user type-ahead or other interference.)