From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10818 invoked by alias); 1 Nov 2015 18:59:44 -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: 37046 Received: (qmail 15739 invoked from network); 1 Nov 2015 18:59:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern_com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=jXdequIVmbU1qhqWPAHI+icYjs7DknqXzMXO2BYPuGY=; b=QwKSeUra826HiaWsROcXjyCbTeQ9+k97bDArQ+449RU7J2oHVS+bqXkNMHXSm1nJah e3eCF/Ei3adOPP0hU9aWLBpD4/Ac/43M5W9hs0l5/1wwZ11mkhwVTcpjF+MIAjnrBFyy gyHCuDryOF0ve+hNcytWVoG3K6gqJRsGX1IJ5iora8iW45jVXel1TePcBgVwGCbGPn32 gDnLS7iTTQiFM/I6ffnpIhWIOS5UWU95fyZSJn+Hs+CiH78IEanemAvFWYMGwliPEVjD Phe89DjDuJN9nOcVc21mvJWd2D0NKiT2TRaAE8GKED1KqaAHjU+sr1r9rRr4W7/A1Fxy YdGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=jXdequIVmbU1qhqWPAHI+icYjs7DknqXzMXO2BYPuGY=; b=SBAgWlFp5kVZJK46BkIX2FVXUFPlmgB+/22CKgruvawedxrGwuALfoL5kzZ/pWQCLq bSi34qjfvVw1+GtNrQsLoHbnFR7BNsu/blAJISFJYxL+PkJG7mgXNKXz8vhMbI/sYsQt dnj9fvAr+fHwBLtiGvr7JtwtrBpIHZgu0sUj/73UeRFnGCNUVfGpMskrTfSI7jTEj0+3 MGkwAcJ0gHwt9S2HdlPLxODX0GOvC2zTOeiERn34aw+C9ArMrMdnmcHDO/6ny4LEw4fO EG7JuREaj3HxFAzsNlPxpNMR/mWC3KUJDA7R0MIyzfIAmyFYRbvhA/QQ6GY17jBoVBr3 hVdA== X-Gm-Message-State: ALoCoQn9PozyitguDjj6tdi4zpRtbS8Z14UxSTseZ40koLgvLaXBs717Pygsd89OchLZZ+EH9frT X-Received: by 10.182.97.97 with SMTP id dz1mr11613794obb.17.1446404381002; Sun, 01 Nov 2015 10:59:41 -0800 (PST) From: Bart Schaefer Message-Id: <151101105938.ZM16472@torch.brasslantern.com> Date: Sun, 1 Nov 2015 10:59:38 -0800 In-Reply-To: Comments: In reply to Sebastian Gniazdowski "Re: [BUG] Line number in prompt after `zle reset-prompt'" (Nov 1, 4:18pm) References: <151031132331.ZM21501@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: [BUG] Line number in prompt after `zle reset-prompt' MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Nov 1, 4:18pm, Sebastian Gniazdowski wrote: } } a() { zle redisplay } } b() { zle redisplay; zle -M "test" } } c() { zle -M "test" } } } "a" and "c" will not reexpand prompt, while "b" will, apparently with } no reason Each of redisplay and -M is setting a different flag indicating that a part of the prompt, buffer, and "status line" needs to be redrawn. Only when both of the of those flags are set is the display considered to be in a sufficiently indeterminate state that the whole thing needs to be regenerated. (If you reverse "zle -M" + "zle redisplay" the prompt will start to climb up the screen and the -M text will never appear, because those two flags are now being considered in the wrong order.) Ultimately this is because ZLE does not attempt to do "full screen" management of the display, i.e., it does not maintain a full internal mapping of the display to minimize updates; it only tracks horizontal positions where the prompt starts and ends, and number of lines used by the prompt and the buffer. So it will do a complete repaint in some circumstances that might seem unnecessary.