Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) 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.1
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=4TE54uLqD7WoiyubQpFdHzNXupZtST+rffyU2n+jBA4=;
        b=TcHL0mMCYNcoTeUv5bxoNdKKnhlWFCmStSuZcodOS6+vmpUkFqfJME9gogjXr9dzyz
         24QpaO/YQVmGyYEFnBZF+QxcANGggno1mTsfYgeCeNReWQc1Zaot9O8zU6GI+fd+7PvQ
         NKLG9V/yx0SCXdr8dtOafYT4HThDh4Hz/ABfprXVASOM531Q+pkF8NX5Je70Td2L1ejb
         Zskpa+KEEVB3vqOs9/uraVywoOGigzV9OaXyN+DBnTQdSGzeLK+bGZN6y3oqSL2lQzZe
         cKLyVfgeot44Rnx8ocflXxeO3UGRLM6vv0h7nTvGw0grNX34782ws9vusz+1RzsMjFxF
         pAjA==
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=4TE54uLqD7WoiyubQpFdHzNXupZtST+rffyU2n+jBA4=;
        b=Si2YE57YwWylTA1VoN7ryTXd64/+hI1HCUJzXAMfm38lHFCydfbA4auRgSdkEddl/X
         0e0ISOdjcCbErQrpcR+lpcBTJMnlFGqPtfLjOK9nhjPqsVnTpKpHyhUfzAQernv8oXQc
         RsNusU0oJIN1G8yuJv5MlhFfzhO0VYnFoOsqZ3rWGScbiy2X7zqyMapGSf1iWPNhcBGQ
         CnwPXOkXhMronE8kOcH8fg3KSYawyk2ZGc4Kmgnw0DYzFMPygjqfM2J9J1Pvyqu+ydRy
         y863pGKsp0B48GCvy9XRp8zcOOe/KpSbLWe36ZkpomJTjqr8PC9ZfTfiyNy41Z2FYQ2R
         KFTg==
X-Gm-Message-State: AG10YOSRzaGS3A9Q1iOOlW2BKw/n0Bv7V+yvE9z3n6l8JHZC0BHuTZ+EZFmJ35XcfA5MKg==
X-Received: by 10.98.64.132 with SMTP id f4mr11719796pfd.159.1454600252626;
        Thu, 04 Feb 2016 07:37:32 -0800 (PST)
From: Bart Schaefer <schaefer@brasslantern.com>
Message-Id: <160204073731.ZM25972@torch.brasslantern.com>
Date: Thu, 4 Feb 2016 07:37:31 -0800
In-Reply-To: <20160204141206.GA9349@cventin.lip.ens-lyon.fr>
Comments: In reply to Vincent Lefevre <vincent@vinc17.net>
        "clear-screen widget and prompt expansion" (Feb  4,  3:12pm)
References: <20160204141206.GA9349@cventin.lip.ens-lyon.fr>
X-Mailer: OpenZMail Classic (0.9.2 24April2005)
To: zsh-workers@zsh.org
Subject: Re: clear-screen widget and prompt expansion
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Seq: zsh-workers 37879

On Feb 4,  3:12pm, Vincent Lefevre wrote:
}
} Shouldn't the prompt also be re-expanded (like when the screen is
} resized)? Or is it up to the user to create a new widget for that?

There was a deliberate decision made a long time ago that once ZLE
is started, the prompt is a relatively static part of the editor.
Originally this was because prompts are formatted by the shell (even
if ZLE is disabled) and ZLE was treated like a separate entity.

Window resize is particularly tricky because, depending on the window
manager/desktop application, SIGWINCH may be sent either only once
when the user releases the mouse button (or otherwise ends the drag-
resize operation), or multiple times in very rapid succession for every
incremental drag motion.

So it's left up to the user to decide how to handle that, typically by
something like
    TRAPWINCH() { zle && zle reset-prompt }

