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 28272 invoked from network); 17 Aug 2023 14:44:24 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 Aug 2023 14:44:24 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1692283465; b=MIjIm5WguPnEnN55iuQ/Pmy94SYXRJb6zIAasbNHr60Cx/6PYbevOgSpeVXbqrpX3AZTlNSij/ Ub3LOM7Hmi7MZz9H7h6r22aN1QUMNifgIAGgfAD3nOcwRj25ZbxiTs6Y6miy8NhzTfBvpw1kFG yvQXmiXJvkICGqOLtzwj1ui0yik+4N9q/U1e3ejnMHx40M1T6YYcFZLQnr5TQp+mqGL8+UKkd1 A+TyApna4aX3R/ncvpP56y691fbLKlNI7oJb5sA4KFIu07cWCR/WzPMSePZPFDu0cvrCCV0xUt MJii7q5nDO0bDDK13JoEeAZjRz/McGiy0SUccgA7/ZaPfw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wm1-f48.google.com) smtp.remote-ip=209.85.128.48; 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=1692283465; bh=1bevq4vJ2cz/uw+9v2TmT3cccZseszbSBtlh142TRc4=; 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:References:In-Reply-To:MIME-Version:DKIM-Signature: DKIM-Signature; b=Q0T/0x6jpKDTy8LW9qCD1gw90VQkRfCoYl+3HKG2npWlLBWwpILQq3DPtWJXuXIaurN2k+9RQd veAhUh1163+o6Gna1U3kPQtnmgPP2ijIJAp81YDcxS2GFlmkUjc2Kkz+tfNXE44V5rCzDUY21h 4X5V9VxDctdM8GqWlsqu69Uoyk+SxNAoFbsxwH+HNCieX17kstZwGx1TKWfwMPwJ3RNo6YM7NX kDbbx2GjAd514GJy1raVs+TVU+4a2boZ8gy/KRVrdITEYgfqfVTFWDIeZAHDlOv19TxiZ5/PUg rAPrad89DDoMF1SYP85buH9ZqOsMPCW7UPIdR14j23aEfQ==; 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:References:In-Reply-To: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Ppg9K5OxdCiB645R4CoE1wjTYN8IyGbechrlmhLv3HE=; b=Lmz25kjHeQE1TsYITT2UuBvq5q ygKkjKoxOxrCAToSkfoXVUxvGfRjJfyebju99yb50kJqMz8pDb3UWxV0lRIe9ov+jtQkjRGDPwhfk y58plKVOtc6rTZtZVxczucNbG/1wuDAUxUg9VmrCuadXziKmsTOaMeynm2y1mR7Av91XSSX874ACw EW03NqWGxpE5hvyBkX1NNDs3Fwf4sd+bLrg4VbAJ9X/BMQjH3ECjpxyiCnBdoVBDBWE07zBR8Fvtt bCbeQsAL/RuWP3V5P22UowOsNvyUH4/YCLlYVBCmPMmM56ROolNAfqNmi7ZPr96Kqx2zVanCmQxKB yhbBQB2g==; Received: by zero.zsh.org with local id 1qWeEZ-000Kgd-N1; Thu, 17 Aug 2023 14:44:23 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wm1-f48.google.com) smtp.remote-ip=209.85.128.48; dkim=pass header.d=gmail.com header.s=20221208 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-wm1-f48.google.com ([209.85.128.48]:52456) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qWeDl-000JyR-CR; Thu, 17 Aug 2023 14:43:33 +0000 Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-3fe167d4a18so73742405e9.0 for ; Thu, 17 Aug 2023 07:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692283412; x=1692888212; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Ppg9K5OxdCiB645R4CoE1wjTYN8IyGbechrlmhLv3HE=; b=NQanm4N+0vJ8fCfIWL0KBgjnIxgojTncDYPS3kg/Uf0GrdBxbHKnT93yWJeWjRZT9h +t77D/tN5mAsWSEUcX9KFwGS7vRl41Vbuysrx9KXTSoibr4/cr2AHaX2UMifVlusFaub TBF4gw36JRQNP3U9HaaAKQucMJtsXTL2xIAJauF3Gpl+DOKSOCRicohcEtyGO5ZjHref gTOCvvISiMn469Kaax/Or/ZWzHQQjcIc8sNR+6RIRN5WWEuZXUhmIHFGKJLh06ve4I8f ktm/yJs8Zb8St2x7Enhrni7JE0LEYOBjr/hfQp1fH82cp4CVaHH27/6ghAdvcVFkaSws /dkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692283412; x=1692888212; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ppg9K5OxdCiB645R4CoE1wjTYN8IyGbechrlmhLv3HE=; b=jxZwLre4shEVKtEecO9DJSsu605BKqQpo4nHDxG4uC8E2WDJEL2wnyCq/ROaIIhLRP lG8jaqtE2KwtCNOXuEbqT/uHlL/NiaJKnnAf8bIK2o3mIA6JOO1aDelBSFTzfIu9bX+/ MqW4hbZln6DNC5h6e2iBzh4ggy2QhAxexEMq/gBLhYrORf2sKg8hQjInzEP+4zqVFcJA 6f4Lml52SSJ5Yz42SoKAsyeOOy930zDTnxPojSMLYhjidzM3yqpFzVjYjgUmu1WwCoXq Zl4exD02BM4GYyTrbK9NEP5Ysq92nLZXiKxDak1TGTGQgapgaP6vIQEL9+cPnkuKmhxq 5WMg== X-Gm-Message-State: AOJu0Yy3nazEpuBGpWQ/+uhFsp+rb4D5u8WZvQp6pqXez/qna5R0uMAi ThTsLd0+ho5eJU0eQqeI4+fMxzBhwAKLqKixrK4= X-Google-Smtp-Source: AGHT+IGV5AKV/jZUtAC8OmuK4Ee/1aONhkuTFfuf3CfFFVG2CGcts7bvGgC1EK1CsAYkq/PnXOqHCEV+WRFSiueWEVQ= X-Received: by 2002:a7b:c3d4:0:b0:3f9:c82e:9d87 with SMTP id t20-20020a7bc3d4000000b003f9c82e9d87mr4217220wmj.13.1692283412228; Thu, 17 Aug 2023 07:43:32 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6020:174:b0:290:25e9:9dde with HTTP; Thu, 17 Aug 2023 07:43:31 -0700 (PDT) In-Reply-To: References: From: Budi Date: Thu, 17 Aug 2023 21:43:31 +0700 Message-ID: Subject: Re: How to keep HISTFILE variable untouched To: Roman Perepelitsa Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 29153 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: Simply works well On 8/17/23, Roman Perepelitsa wrote: > On Thu, Aug 17, 2023 at 11:28=E2=80=AFAM Budi wrot= e: >> >> 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. >