From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arsen =?utf-8?Q?Arsenovi=C4=87?= via Emacs news and miscellaneous discussions outside the scope of other Emacs mailing lists Newsgroups: gmane.emacs.tangents Subject: Re: [OT] Not clobbering bash history Date: Mon, 11 Dec 2023 13:09:52 +0100 Message-ID: <864jgpaqbs.fsf@aarsen.me> References: <87ttphlqlo.fsf@catern.com> <87v89ujwa6.fsf@aarsen.me> <86il5g9qs9.fsf@aarsen.me> <864jgy85g5.fsf@aarsen.me> Reply-To: Arsen =?utf-8?Q?Arsenovi=C4=87?= Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2334831650969579109==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29820"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Richard Stallman , brickviking@gmail.com, sbaugh@catern.com, luangruo@yahoo.com, emacs-tangents@gnu.org To: Jean Louis Original-X-From: emacs-tangents-bounces+get-emacs-tangents=m.gmane-mx.org@gnu.org Mon Dec 11 13:15:30 2023 Return-path: Envelope-to: get-emacs-tangents@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rCfC6-0007Xu-9K for get-emacs-tangents@m.gmane-mx.org; Mon, 11 Dec 2023 13:15:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCfBs-0005jX-RM; Mon, 11 Dec 2023 07:15:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rCfBr-0005jK-Bp for emacs-tangents@gnu.org; Mon, 11 Dec 2023 07:15:15 -0500 Original-Received: from mout-p-101.mailbox.org ([80.241.56.151]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1rCfBi-0003Tz-Kz; Mon, 11 Dec 2023 07:15:15 -0500 Original-Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4Spgff416Zz9snx; Mon, 11 Dec 2023 13:14:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; t=1702296890; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Xtn8R+lE7dUTN7rtIUzLzu9w3T7mJp/0mYqquRrG2mE=; b=BizWgWGBThC3jARbQSEwjzrzg5ZZzvxBf9NSy3j5mNnFXu4E+5USmrM2YCVzclTusyQUrF 5yO6FgWLb2auwiDK1+RHAn9n2xvVLNlON3NsrZwFxdkpH3yn3IFyD0QT8HK8LPfeHySDzp 3eZRHFD/JtQOqms7Fh1E8tUAMBk1WPZC3jDgRW1EiJY6QHpA28JiITYZC+DkleIvDM3gJ6 ITs/BlPQiYr4uK1U8NPdXPkl1EN3qioZdREb9SUTijWC649AOS5PXJiN61XoiBF8hHzbUm XtzqfeJp4bJTSs4UFKNbCY/O0aoJIbkCiUH+zHcJz1DT7XWEKjbKItWiR4GRhA== In-reply-to: Received-SPF: pass client-ip=80.241.56.151; envelope-from=arsen@aarsen.me; helo=mout-p-101.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-tangents@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Emacs news and miscellaneous discussions outside the scope of other Emacs mailing lists List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-tangents-bounces+get-emacs-tangents=m.gmane-mx.org@gnu.org Original-Sender: emacs-tangents-bounces+get-emacs-tangents=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.tangents:1145 Archived-At: --===============2334831650969579109== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Jean, Jean Louis writes: >> > Say that the history has eight entries, and a ninth was added by a >> > parallel process, the current process would be at the point after the >> > eighth element and should continue reading from there next time it w= ants >> > a history entry. > > Arsen, explore options of the command `history' to do what you want, > you can save history: > > $ history -a > > and you can re-read history file: > > $ history -r > > and by using those options you can mix history from different Bash > sessions, and also re-use the history from other Bash session. Thanks for the tip. I already have something using these flags implemented: PROMPT_COMMAND=3D"$PROMPT_COMMAND;history -a; history -c; history -r") which is a functional hack, for the most part. It still has some of the problems mentioned in my original message (history is only added to after a command concludes, sporadic truncation still happens, etc), plus this approach is rather ugly. Thanks again, have a lovely day. =2D-=20 Arsen Arsenovi=C4=87 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iOYEARYKAI4WIQT+4rPRE/wAoxYtYGFSwpQwHqLEkwUCZXb9N18UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0RkVF MkIzRDExM0ZDMDBBMzE2MkQ2MDYxNTJDMjk0MzAxRUEyQzQ5MxAcYXJzZW5AYWFy c2VuLm1lAAoJEFLClDAeosSTY64A/3ViaTqaXJmnaBRumTFYyfuqzRxreB0b/h3X Uauj9cQOAQDlHRgE3TSrpUWAgPsPZ8/jD7QvjzNNCrzjSrz4dKR6DA== =Upmr -----END PGP SIGNATURE----- --=-=-=-- --===============2334831650969579109== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline LS0tCnZpYSBlbWFjcy10YW5nZW50cyBtYWlsaW5nIGxpc3QgKGh0dHBzOi8vbGlzdHMuZ251Lm9y Zy9tYWlsbWFuL2xpc3RpbmZvL2VtYWNzLXRhbmdlbnRzKQo= --===============2334831650969579109==--