From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16752 invoked from network); 17 May 2021 04:48:52 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 May 2021 04:48:52 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1621226932; b=aWre6CghhwY3NdMXL1oFIGuJ/yChE4pTdX6Z00dqLfxCz1VzazOKbNeTqVUR4+cRMkJ4QgQL6v J2VaOUtIpoJZOB2amjS2gGTBRyOOYwgLYyEmNRw/Dc1ICaCUjC2YEpcL7wmVcOW80nm+NJ+CCT TFN+bpBl+rTJdQAK0D5rSt/cj1RL0w62iyY6yEiBnafH7isg6VIeZRx4Hdk1RIfgKOahqVSyYv CLg0N5NopaLV3u8B21wt7VSVpXSlizlYIKGS4Ebm4BzzmVIjYKwGG7zbIt8pDx+WE9+UrlAgN7 SJE/M/txon953U2dC63F5NRRSpSfB5n378k/vJ6bFDyNFQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-io1-f41.google.com) smtp.remote-ip=209.85.166.41; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1621226932; bh=uLgzCediFzriWw9fzkzeBUqI9dNl+7TDliMhLC8MSBo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=uSesii7W+dwftIJyA9MVDmrrLeQDmzIRAL+jkB3WYzYiBjNRzR9hdd6AGyCtssIQQk5K1UDjC1 xOGOsYXpQifCwOEk5txvtB2Rma46pjGHD+js3qm/bQBHmV5JUrwtTuMy8Zb9nO6e+l2od+8T9O 5z5C31iwGT4DYsZGKw4a0QRVS/85tFmYkId7PsvXUq2UgFjyLrMKJDWtW7XbmSKQde1AC7VwFY CatJ6HO4HQ6e1eIspPAfYt/N/8WHKThI3N+9tWwewNholVUEXAwFBAob+82NwCa9CpPpkWS1G7 ouHordE0rq/TfGVdGr45m7CWbvDlzMWEwTuKpiaaMM0yxQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=tkqZwaE0sHtOhGcCo7fVt7Qm7ZcjKco2QdyyN8rbiBQ=; b=aObRoFKndVgiUrj81IhHtJzdeH cCDGCI3NUQ0byXz0V/ZT6J8PUaRBswnrkWdebhgGiVJeGdRXztyygztJVtwNpF+w5Wlk7DcjEwW1A tzb7qluY41oA9mpAIQrpLqQqOM3ryHTfP/Hc6xDodtFUnGkbqQUEiQcVucFPsa5iPvbcwwowdJQkz kVlfnIKG4mTKFo6uCUp8m5/rv538+4WS5UgrbhxSn9pgM0aGZEAnPVzTR8+k2k7qAovVHdSfUZIKr ws6YXcnE6mqydBDy2+i+zGUqP5AOYaKHs0sddz4VlDgf9BGzre3OaMd5WoX5qoYpZhi+DTS6L23Hw +1zRQ0hQ==; Received: from authenticated user by zero.zsh.org with local id 1liVBU-0003ZR-GW; Mon, 17 May 2021 04:48:52 +0000 Authentication-Results: zsh.org; iprev=pass (mail-io1-f41.google.com) smtp.remote-ip=209.85.166.41; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-io1-f41.google.com ([209.85.166.41]:45631) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1liVBE-0003Fc-Uh; Mon, 17 May 2021 04:48:38 +0000 Received: by mail-io1-f41.google.com with SMTP id i7so4518780ioa.12 for ; Sun, 16 May 2021 21:48:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=tkqZwaE0sHtOhGcCo7fVt7Qm7ZcjKco2QdyyN8rbiBQ=; b=czRu63FY++EF2kBLuNc2lkGuKLRswl66JiapKWlgGsD98Bju7M670b7/QHkXkwBAXs IOy6sjOEj4luGJPpjg13o3xpEBCmsN38t/NwVvULJZXs6RhzIYgZkE65ZqKDcNpCSSOx WGkJ+p6QmpHmgNnTC+ApaslPSBIOuWI9fbvAJnLI2X5NICZ3sEUiKJWV4+LXdNtLdgMp P08+75Hot1fYantqqnJpQaRaoIIeERNZ9/cOjQjZLEV1Q/qwj2G2bqM99YWaZ7nAqj5+ tEKHTXv+YDjkiwlQ2imE2SBNnzFC9QUXt3amZRLmBtU5ZYjxcFRH9L7pGSrWArM9kHKq qUmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=tkqZwaE0sHtOhGcCo7fVt7Qm7ZcjKco2QdyyN8rbiBQ=; b=o3yenElJSEZrWQR+UxJsUyrj2s9mJL8x0OcT0S2WA1DJvuMOCsu4BGJjYiTXoBCQLH qJ3t1DPt0seMQEQU2psqOtSTzqsjOAm0on9/qHo8/9IU7Ui08rhNJ71w9y/D5MiXcDwl RCnNbVoNRTB0sad4K49o44DNEZKyL7xLElF9yV/poxy5fGuZlUfhyJWS757y4ZSvGMNS WDEzhnf0z1QjZwedxGsjpmRWzLg0mERS2CZbaSScRi2B0ibrHPMC/lzvQmD+tF7caNCd pWDM4qOhcV3uExs/evwSDosdak//93FpZnA9/eeZV2qcuwuyLhlkinD9JN5WADVIdjKL Z3Dw== X-Gm-Message-State: AOAM532nF1FtmJSMOSYaZu2ih3Hnmxh3j3FfK9o3e4agIfSKFZEJMjlK TYTH1dMi9CScyZ49AC62bq5pYscSisXPzekVW9dEsZhy X-Google-Smtp-Source: ABdhPJxZqiKsi54SiQ/2ssnjy1J1wuxmvcSiHdMXQN0dS8nbc1Xd0Di8lP0VCblEEhOjEdyfar6NaDauSWQSLfUTusE= X-Received: by 2002:a02:630e:: with SMTP id j14mr54599809jac.115.1621226915609; Sun, 16 May 2021 21:48:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:cc46:0:0:0:0:0 with HTTP; Sun, 16 May 2021 21:48:35 -0700 (PDT) From: Mikael Magnusson Date: Mon, 17 May 2021 06:48:35 +0200 Message-ID: Subject: %! prompt code shows incorrect number To: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 48862 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: With two shells, incappendhistory and sharehistory active, this can happen: PS1='%! ' 29 echo right right 31 echo $history[29] echo left Needless to say, this is surprising. Can it be fixed easily? fc -l reports: 29* echo left 30 echo right Perhaps we could import events as numbers that are unused instead of overriding the number we have told the user is going to be used for the command they run? (I am posting this without any investigation on my part as of yet, I may look into it later...) (If you're testing this in zsh -f, remember to: setopt rcs; HISTSIZE=100; SAVEHIST=100; HISTFILE=/tmp/eventstest; setopt incappendhistory sharehistory) -- Mikael Magnusson