From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10818 invoked by alias); 25 Oct 2010 14:32:16 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28365 Received: (qmail 10440 invoked from network); 25 Oct 2010 14:32:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <101025073146.ZM27162@torch.brasslantern.com> Date: Mon, 25 Oct 2010 07:31:46 -0700 In-reply-to: Comments: In reply to Mikael Magnusson "Re: Fun redraw issue with double-width characters" (Oct 25, 6:14am) References: <20101024191229.0bc47b23@pws-pc.ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers Subject: Re: Fun redraw issue with double-width characters MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Oct 25, 6:14am, Mikael Magnusson wrote: } } I am asking this only out of curiosity, how come updates on the first } line are done like [...] } while updates on the second line (ie after wrapping everything) are } done shorter, like [...] There's a complicated algorithm based on querying terminfo/curses for the "expense" involved in doing any given screen update, which is used to decide whether it's more efficent to send terminal controls to move the screen image around, or instead to simply overwrite what's there. It's possible that the computation of "expense" is wrong when some of the characters to be moved are multibyte, but it also might be that what constitutes "expense" doesn't map directly to the number of bytes that pass through write().