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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16382 invoked from network); 17 Aug 2023 09:41:25 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 Aug 2023 09:41:25 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1692265285; b=UygsPTe5TFoigIUBf/R+JhGujGPac1MOHeKbgEi+jt/Kk9RYc2wLU+CzWAjZWb92/23WoM54Sj BgL7EFqwMHfAeBK6t0bim9Tc8Z3vE9XowEbqPwh+6/7bwH8TYCjsB9LSELyF81tUMCGwq6YjP6 SiI2c+tomrqMboaGJRAnaxNlJZXDzWSlcafllQ1JshUFKHxZGp2UvKzCJoj6xL8+MWgFZD2rbZ TUkCWWktvLKV1HD3W+Zss3F+y5vJ4yZK1gJbfR2diK6bFBxp3FteQZSQ1k76tFPSa5NxygAkE2 Fa7/OdC9d+8gLDapDGE9wi2UkLySiVAddO3utHsvmy27Ng==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f175.google.com) smtp.remote-ip=209.85.208.175; dkim=pass header.d=gmail.com header.s=20221208 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-20210803; t=1692265285; bh=yBuUoE7N44G8Uybz7O9u443NFTBB16orrInKf+No9CM=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=eejfLeUaSJi8w/y6//Fca1PH0FeeeZMe9wkmTvAl8zU+b+xY9Xy6d6MoJ12R6LRiMW5HPX609o MCnE3ER/sbrnGbyCEpFMpJCYLGGMXpkOkQ1QSHM/oaemscSVL8IifB2ldznOrh8LmICxskDaar 30Tt+AViWHuy7Kes/kjelcuI9qqFAG/xk2bBixdsDeud+tJEimT6rcvDglYRcxVkgUbk9SJFsS v2ZGda9PwnHsAmsGVxV38kcsKjqeinU4YuniuqXbODHIGmdpAXtZ/Mqy2KsGRqR3594UeMcfLv FtsDu+LCNDkILH6Jkv+8S9mOcFxoEA38f7aTZ5F1oR2aXg==; 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-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=MIA5EOqlO2neafTV3o+cMe8zWuZk+mFHiwO5jk/uWq4=; b=Wcs1qDXoSKQ/ztt7Se4zWd4QFO chm/rdbYVaUfwo+A1eonL7s6lZNUhGMMERzv7dMqAP3xXI8nITm6cFyz8il7L6HU9ysu7ZAg6oCGD fvq4ofzuxrG2wuq+FrgI4bZKPnmXFbie1pI7hn9RCbirHabQdFFmrnB6vQDrF45EtX2PUObwllRnX VWx9y2j4LcGmuXOOreCa+tgGPhksgmfRFVk2IwxEo6MctZmmYFDQm9GHMtTUg1m3Jt4b0eXUyvGWC WiVW7OiA5VAaOdPhx3J/Tywru8PX2NoJsWafd42W05zu3oZmRBe6wKlU0Z4aA2ZB6tsHrwt/MHfw6 ZMXFQOhA==; Received: by zero.zsh.org with local id 1qWZVM-000D0u-NN; Thu, 17 Aug 2023 09:41:24 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f175.google.com) smtp.remote-ip=209.85.208.175; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f175.google.com ([209.85.208.175]:51656) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qWZT8-000BpL-Kk; Thu, 17 Aug 2023 09:39:07 +0000 Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2b9cd6a554cso110633751fa.3 for ; Thu, 17 Aug 2023 02:39:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692265146; x=1692869946; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=MIA5EOqlO2neafTV3o+cMe8zWuZk+mFHiwO5jk/uWq4=; b=aGj1UNekjQKq7lbSGD+x77cU7+lkbaE1ULj4xZr0MRkKLiSUc546AGVpIg2Rv0y7rk Si+QI067VvcHf71koypmsk/tPy6nxUL0/b8WTmMk5eCI3X3rnAg3UxspoAzOlvtANQBM W8xwjUQja02M95Tdhh6//6reg6xGSSZJ5qE2DjNtl6SszR8elszMNjvciHHcYQxXbMOl vSkNac3UIg32A3YaoZ7OtJJ8XqzDv15aHRqil0j/l60YFqGLBmCENTUfuEjJmpuDYUzw Jy85IePNvNWbyxrADv1e/I8dYqlcQxmBKpQQbNskL29YjVIJ/zWm93hZxOraTREGVkKz hHXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692265146; x=1692869946; h=content-transfer-encoding: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=MIA5EOqlO2neafTV3o+cMe8zWuZk+mFHiwO5jk/uWq4=; b=OCbmXoSqhU1S5MIezTCX549djGblB76MqSgJ7yGj95hxST6DqQe4QRNGpSH0A7UA7+ DGNvcHXFYRrxHvKX2JOdkU4oxWjJsaW+bq7untUKTfDJstx0p5rO4RfKznLsRggpDpMO /yps3gtHSXaYnc6vAihfupi9fWSfdZ+hkMnsWJXWhq/caDXpOQ051Che4beQImgIeCJ8 5djUQFxGl5boujnD5fLBwR57YUJSVigF4GC8iuEscoX5aJWZtwYBpFWgdhr5DKxdO3x/ a/awVanh/eauHBlus7GKH/Ei/rs35IBbyU0VYxwvBdR/mrnwh9hUh9TMR4dtuQDoi6a+ r2mw== X-Gm-Message-State: AOJu0YzhhlVCVFYwhxG+Lt3+yOLWGWCcmkHvr8Yd3ZMKg7FIwY6d4nGA aa7rznFyB3PJzMAFehuoEX2NC6vws2flj33W/335KzTnK6Q= X-Google-Smtp-Source: AGHT+IG0TYtUtrxw91GphUfURxVm5Vg39e7sq/G6PMVO3rvOxQ4kVs1siV79NGmTmLqIFUOW3fI/YpTNpWNS0aJBpP0= X-Received: by 2002:a2e:97d6:0:b0:2b9:e0ba:752a with SMTP id m22-20020a2e97d6000000b002b9e0ba752amr3233082ljj.53.1692265145384; Thu, 17 Aug 2023 02:39:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Thu, 17 Aug 2023 11:38:53 +0200 Message-ID: Subject: Re: How to keep HISTFILE variable untouched To: Budi Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 29152 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: On Thu, Aug 17, 2023 at 11:28=E2=80=AFAM Budi wrote: > > At the end of > > % history -p > > The HISTFILE variable is cleaned up > > So how to keep HISTFILE variable remain untouched on any case ? You can invoke `history -pa` from a function, or pass $HISTFILE as an argument. What you should do depends on what you are trying to achieve. From the docs: fc -p [ -a ] [ filename [ histsize [ savehistsize ] ] ] `fc -p' pushes the current history list onto a stack and switches to a new history list. If the -a option is also specified, this history list will be automatically popped when the current function scope is exited, which is a much better solution than creating a trap function to call `fc -P' manually. If no arguments are specified, the history list is left empty, $HISTFILE is unset, and $HISTSIZE & $SAVEHIST are set to their default values. If one argument is given, $HISTFILE is set to that filename, $HISTSIZE & $SAVEHIST are left unchanged, and the history file is read in (if it exists) to initialize the new list. If a second argument is specified, $HISTSIZE & $SAVEHIST are instead set to the single specified numeric value. Finally, if a third argument is specified, $SAVEHIST is set to a separate value from $HISTSIZE. You are free to change these environment values for the new history list however you desire in order to manipulate the new history list. Roman.