From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 4501A2284F for ; Mon, 28 Oct 2024 17:43:41 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1730133821; b=mDHnMXGmxRNuBRqlPxjk60tT0JgiZyFIWHFrkvcxnE3BFqIKkVQpVvI6xqboiML+HfW9a5eSjl 67ltMHXIg5tPYPqowCHe5Jr1tGklszkn0oRM9WA6rTD/jGoVACWlotPnhsSQJEWt/UJEdyx1MV nZ0lbQs52UoR0pSJ78+FhnbYaQFw/sMm0TgvgY1rfbEB+An68iQUjhziWuQWGO+4MfRcqtShG5 P3fjuSfaCMO/9ALFPxcN51Rff6COPps7p2Yl6sGaXueItwPkGPmKUnL3JTXwZTA3FI7Bn5SmbF XUCX43I/aJBj0Q0rTZhHMP28xm5sq7CqSDa+QfvaxuxX4g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f51.google.com) smtp.remote-ip=209.85.208.51; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1730133821; bh=C4nrzhlSPYPGYWFQEz5ceHy0YOxUlD+O83/hFq5x0Z4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=hgIfdHXuW1MeveHme+zq67fJhRSmghG33vJoXsWfaXujcub5rZHn73n9eCvdJbNRW4byl5f5ex s5tywqe5Rz5ZMdoVZ2FClp8IwBivJHrkrEWipAWLPQEJwFUoO6Y1KDSWBOuFipXV81C+U9uFsc rqFXzxwNUkEHtVai2tXC2mZ+4DxFz/27RXDmC6QVy/CHpTsXNVV/DZE2t7UJzFrJGTu8zssks0 WYIAm9elWh8BpZq3d6vVWmgI9Jlh6MYTfax5K2ni6pixXKdZIHwLNUzJcEWeokfvs59XI0P7x2 7dAK2xZWKKGQymNFfROulTzT7RdriL8UlQLpuCjl44vWNA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Cb2tDTih7PmIMWuMdszlMzrPJ4TaGYHN2ihSCJ1IJvQ=; b=R+RS60Uh1EyATX8PsckfTctpd0 iA7+1kgPsSLRX5A09XgdW6ShfzkDsg07t2M4vK7JJvIlvBLZO20xe5jTDOhWWB9LaYHkoqoe8v+H9 26sHp3W/y5Y1mpROApIf9LxbEK+ttG2K4ePdw/sL5kS4hG5kg5GdUdK+ByaGpSBkKa/OJsdtzwwJF oO5N026/BCKjzjVhhr2/PVT3KyauHEjgjNQ3dIezdwRkjpzICKY9jViSKvUxYzqWhbYb5vJo452vt J2zfckNiYVvfspOHB3Rt3nq019TYl0TOkzF2+C4idF5ZlT8Zeiz7yzYc/dRpaeTQpwA+GG+qOGE7y 1xNfDazQ==; Received: by zero.zsh.org with local id 1t5SqD-000D0U-30; Mon, 28 Oct 2024 16:43:41 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f51.google.com) smtp.remote-ip=209.85.208.51; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f51.google.com ([209.85.208.51]:39259) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1t5SpY-000CJH-Sn; Mon, 28 Oct 2024 16:43:01 +0000 Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-5c9589ba577so821428a12.1 for ; Mon, 28 Oct 2024 09:43:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1730133780; x=1730738580; darn=zsh.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Cb2tDTih7PmIMWuMdszlMzrPJ4TaGYHN2ihSCJ1IJvQ=; b=M6pmP6xm6uQS1FCZvcOfotvcI7sto+EyEt41gu59F7OhJhjYCKcAgil5IevQ0wvfG2 iynWEWMgpDvhcy0bAIPQJqecjqgfazA0R6VAN8aULwrAmLywBMp1QrqmlYbxiFAUlNft ymRKNCqbwdc7kEid6mTJHZNFK97lnvhEkHgtFoVV+D/dgPXEGPhhwghgIqPKk7EAlf2j q6ETo9dQO1q6rUWoqWx6I32aQGLrdIF4tL2FM4JLcqdkr2lLkoXsSVc9jn2GcBDG7e25 fJDRUTfQUuWhHxvJ8bjGt6xRejqoifu3ybKsDqJdnG1Bgqi9m8aWOlM7EOLDp276KHkh djag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730133780; x=1730738580; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Cb2tDTih7PmIMWuMdszlMzrPJ4TaGYHN2ihSCJ1IJvQ=; b=la4EgNwuQDAjhXccTifI+ajwpzQxWj+Qyz/B4RtHw1+lIM5dIXb64sZ4TpqVvB6a1R PB2d+6udMlTWQXcjWlkFXoAHNgcqLnv0rwtXhDJTm9BrcEubWy5+SWDYJJeEqOZp/oTz pox1UwCUAfwFjiKlxf/LTdw42WIqwmV+NoqHGfiyWN53wn3R1DaGhI0Uu61WQXBR0itq al9c+EFd42cBUBDW7YX3z0hwnyVvYiu8PkXspXPrbjWidvCsqR/np9GJX9zhMQLExCBm sqYTJC3ZhEgpnmDlVQz7O1p5lShUuJzBP2EJ2BYaT7r8g26alpSA7mMQmq/EpALdSwDm dN5Q== X-Gm-Message-State: AOJu0Yxu+3vzj8Xlp0AXWhJdK5sbjdZv6TovyhDxN7TYGUgicoulPj1/ 7MWQxBiyIzQNPXO0IQv/ZlMLSS1OrWDpo5CgI5qUtan3A5FRFO3rNTUKjEk2cpqZypyuV0Qg306 715l6asB0EwTr8ItVVU1JIswChkC//rBHce2j X-Google-Smtp-Source: AGHT+IG03cpOk20D8pbFCabRCxrBVGiRIlkWsafic/6G/oVVFB7UptbVQSD3fhRp4Ubl/VY22j0M+zQMwifQH2uLnPw= X-Received: by 2002:a17:907:7ba7:b0:a9a:7f84:93e8 with SMTP id a640c23a62f3a-a9de5ccb5f4mr361207766b.2.1730133780130; Mon, 28 Oct 2024 09:43:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Mon, 28 Oct 2024 09:42:46 -0700 Message-ID: Subject: Re: Foreign Commands Not Appearing in 'history' Array When 'sharehistory' Option is Enabled Until a Command is Entered To: Langbart Cc: "zsh-users@zsh.org" Content-Type: multipart/alternative; boundary="000000000000610a5106258c2910" X-Seq: 30090 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --000000000000610a5106258c2910 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Short answers: On Mon, Oct 28, 2024 at 8:06=E2=80=AFAM Langbart = wrote: > > is it a bug that when the 'sharehistory' option is enabled, commands from > other shells ('foreign') aren't included in the 'history' array until the > user enters a command? > No. > Prepending 'fc -RI' before accessing the 'history' array seems to resolve > the issue. Is this the recommended workaround to ensure that the 'history= ' > array lists its resuls like 'fc -rl ...' does ? > Yes. Longer answer: When you're at a prompt, two things are going on. First, a history position (the "next" number) has already been allocated for expansion of the %h prompt escape, and loading from the shared history would have to somehow fit "above" that. Second, the line editor is blocked on the terminal driver waiting for input, it's not burning CPU in the background polling the history file, etc., so you have to explicitly wake it up. --000000000000610a5106258c2910 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Short answers:

On Mon, Oct 28, 2024 at 8:06=E2=80=AFAM Langbart <Langbart@protonmail.com> wrote:<= /div>

is it a bug that when the = 9;sharehistory' option is enabled, commands from other shells ('for= eign') aren't included in the 'history' array until the use= r enters a command?

No.
<= div>=C2=A0
= Prepending 'fc -RI' before accessing the 'history' ar= ray seems to resolve the issue. Is this the recommended workaround to ensur= e that the 'history' array lists its resuls like 'fc -rl ...&#= 39;=C2=A0 does ?

Yes.

Longer answer:

When you're at a prompt, two things are going = on.=C2=A0 First, a history position (the "next" number) has alrea= dy been allocated for expansion of the %h prompt escape, and loading from t= he shared history would have to somehow fit "above" that.=C2=A0 S= econd, the line editor is blocked on the terminal driver waiting for input,= it's not burning CPU in the background polling the history file, etc.,= so you have to explicitly wake it up.
--000000000000610a5106258c2910--