From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4917 invoked by alias); 28 Feb 2017 11:11:34 -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: 40667 Received: (qmail 4502 invoked from network); 28 Feb 2017 11:11:34 -0000 X-Qmail-Scanner-Diagnostics: from new1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.221):SA:0(-0.4/5.0):. Processed in 2.377976 secs); 28 Feb 2017 11:11:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: psprint3@fastmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spf.messagingengine.com designates 66.111.4.221 as permitted sender) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= mesmtp; bh=yMYPPZFDZyR72p6Spff0snP+Yx0=; b=TUi2uZifK9xewbIB6cSvR jJZpbh53HzYAW7Qo7snt5K3uJSouIvSDJJ7ayn3x5KrnAMAA+hHw/u5RR8Ywn1f6 G2wbU+sH99BsJ7ozQJfaI9T+ZCBsJRm0Uy+G3iJSf7Fz6Hg4WfcH1p5yu71w901J j9IBnC/B3iNdMZ7FpFfvwI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=smtpout; bh=yMYPPZFDZyR72p6Spff0snP+Y x0=; b=c1lRIJr90eVkn48csMzJ1Ae4/RCg98s6SY70UcoiUnYfI7cvLTT2kq3rg Oe5C8cNpvJOXwpOswYyIuuh5KgmMmlbERNN+qj1U2t3B09oC2iGgttUQUPqwWtVo OZOh6p6vGZm5TvZN+ckDRiyC7El+F4/6hCHguqpY1f3sq4joiQ= X-ME-Sender: Message-Id: <1488280289.2878360.895324176.3971EE76@webmail.messagingengine.com> From: Sebastian Gniazdowski To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-715c2c0c Subject: [BUG] Condition in [[ doesn't fire, with "if" it fires Date: Tue, 28 Feb 2017 03:11:29 -0800 Hello, I have in code: echo "Non-bumped line[${ZUI[log_scroll]}]: $line" >> /tmp/reply [[ "${ZUI[log_scroll]}" = "below" ]] && (( line ++ )) || (( line = stborder )) echo "Bumped line: $line" >> /tmp/reply It doesn't "bump" in certain situation. However, if I change the condition to: if [[ "${ZUI[log_scroll]}" = "below" ]]; then (( line ++ )) else (( line = stborder )) fi Then it works also in the certain situation. Changing "[[" to "[" (with no "if") doesn't help. Logs from fault-behavior say: Non-bumped line[below]: 0 Bumped line: 0 So, the condition should fire because of "[below]". To reproduce: just checkout this branch "debug_zsh_execution": https://github.com/psprint/zui/tree/debug_zsh_execution source from zshrc: "source ~/path/zui/zui.plugin.zsh". Then press Ctrl-O Ctrl-P. An UI will fire and that's all. Now just scroll step by step to line before "Append third!", like here: https://asciinema.org/a/1mlc4wnegc6zbrkafv6zudg9z You will see log messages overwritten, i.e. no (( line ++ )). All other steps were firing the condition. Checked zsh-5.0.0, zsh-4.3.17, it behaves identically. -- Sebastian Gniazdowski psprint3@fastmail.com