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, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11950 invoked from network); 6 Sep 2022 20:00:54 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Sep 2022 20:00:54 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1662494454; b=m7z9//OoKtPq9kiQkB56pm3DbajVCfvusPY9VXO/CBFsKubvAw7UYqOyb5iKLGeyOvbq3O9BT1 yV6e+ZML8kngKEjYvUIZTawNWczx442upz1s9czspV0gdMHqmOZ6I57jTESItDuHVODZjnzzaG aaJdfw1jUx2PAFmdyBswmqAPZQXWIIh563HpmtImLNuiB47KGcvVCyvcNyTtRzdmpeuE4FUgLs 4p5Hi9jFeWHtAkaEPHawaEp5OTtxKnoBC1KeTj+p1FmAqPXjeSUTEGryjXqdMuWCgOY6pQapI2 Cty0UmbgDDS26fmrYlDDMgn7T6P/2WvNqU4JyFaNaSVHMw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oa1-f54.google.com) smtp.remote-ip=209.85.160.54; dkim=pass header.d=gmail.com header.s=20210112 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=1662494454; bh=LrDTY/4Xr5yEtxwIrN6OkoDGj9AigqK7PDieJhjOArM=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:DKIM-Signature: DKIM-Signature; b=mSe/mdPeW+m/35AxznoEHehNj6w9DlPwcSkhyRPY5Ae6Iqr3bnB6yxYnmitoM5ytGMgaNITbMq zuwinA8kCMF3C5Jn0/hCjBnS2YLy8nLFj2/8pXkVUocSjbZV1Vzq+bhlHBy3xY3PCHlhkeY+Gg bkA/m+lRbN2Pi6RZALWMjbdvgbF57vDZha0Vmworuu9UXPXQQnd3dayi58DFmti92UF/mwwNOZ vq1vZJ7YbxRwkQNxHOTmj1f7JQyJhFK2LcQHxL39Auz09q1ifyYHm/q0hsCSZESX6VbfvpJX7l CxqJRN0oL+DPQj7OQFGHwnsSUFpdYENBMfiJ8lcNFI7N9A==; 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: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=DNOvEw3isOy9wL/6yQ1PUlkCLM4ZC1vBmTG5k8G2wzI=; b=S6rAloc5IAREtA5VC+6T53a7aW yc82X8RYp54Uo8yOGBPBDYZrWupS6IuPoaVOjpDKTPhkAKbcvvNNOIbJJnnGZWea0zKa1ZB5HM+d4 4/UN9tKFTHpcpTsUhQFfikInAyI49MQGbyvjSQS/qInJkGR/8KCXoHccOmJ0s8rpsPDtmVBq2M8r4 AyfyXqr1AJ90w6/bgdbCAswFeSOHD3dyxB3CFV1TMC4UfZb7VeSlw/soF3rhbvaudzAKEEe9CrWwd m4aS7FS5N+c7dEa8+TN1+gpqtMkMu6s/Go9OTfDGcE8eyzC32YSJEgrHupFPCuOgCRcULOTpcFNE8 IUQUBWGw==; Received: from authenticated user by zero.zsh.org with local id 1oVekg-000Dl0-Eb; Tue, 06 Sep 2022 20:00:54 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oa1-f54.google.com) smtp.remote-ip=209.85.160.54; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-oa1-f54.google.com ([209.85.160.54]:45012) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oVeaH-000CZx-Ih; Tue, 06 Sep 2022 19:50:09 +0000 Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-11eab59db71so30740028fac.11 for ; Tue, 06 Sep 2022 12:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=DNOvEw3isOy9wL/6yQ1PUlkCLM4ZC1vBmTG5k8G2wzI=; b=YYEDEWceLgA5x3Rrl99VwxMA5Pq0rZAlpVk2DLs+piI4rM6W0vnII0tyLlYv0Yg6ZG G5n3UK1HN6YCyjsq7k9N6LQYMV8fDry28zHK8aMbJmUsV9U6GXwWRcfx7pawca7gBk3p WIFEwU5l04ZqVPSDfvVVVgHwcunBstTEzJVBQFBru78JwaP8OmekvgUfPbqoy/iq4kfp k2RwEeZHWsvrGTxhpteDoqi7ddsSP+5Pkm7FFyfvS0xq7sZ9xDTvRxzVoQlQGH50xqGh CirpI7ZosUZ5vpK1dbT/z9EwSN4hXkV4THPRjASyESr9WdFvonQp4jY0WbJ+5fwclvbu 9nBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=DNOvEw3isOy9wL/6yQ1PUlkCLM4ZC1vBmTG5k8G2wzI=; b=b71UVYg2qp+3iGFhj1vQVcKdurFq32rXxcUrkTTAt62LxoWFz8Rk5nXwsktxQRu0mv ffJSRon4owTvGjOjXu93+7aShizBwd6dVGYAbMv8dmt4nH+T34Khi93yv15mWqE8RWbs LSDnJfmbhmnIYygG5B43A4p+PMdUu7YEstUy7GKqrpoJ0FKJab4uM65YoHqdAgLTtNM9 ZRlF71/AdU0WyM6OSzh2pvasES5eDgmyG+tKACUqhiO2R8wOFgCxAumNlfrRazrumdA1 3pHbZH6HcSbIOvGYpSigiaS9N0Fu0JMVlHUIYv5lbpnMnYc1pqUgI6YImKzs3UEzbxue prCA== X-Gm-Message-State: ACgBeo3BHtTV+dbhmAmZ8vzzqKJq2E1bmlW8T/M3akKKodyVq0gn0X+W J7Ih7ktgHMsUITGYBnJ04j1HL3zNzzM+8w== X-Google-Smtp-Source: AA6agR4fG2cKXfAOOmpDVa47zuU0CCTKcW/CSVFujajcD8ZIMTCWH+JOtbuFXp258DbjI+YKXWnQ2g== X-Received: by 2002:a05:6870:9687:b0:127:5a1c:88f8 with SMTP id o7-20020a056870968700b001275a1c88f8mr9409oaq.14.1662493808260; Tue, 06 Sep 2022 12:50:08 -0700 (PDT) Received: from localhost ([2806:2f0:4000:eec:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id e62-20020a9d2ac4000000b00636d4e8d480sm6222478otb.19.2022.09.06.12.50.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 12:50:07 -0700 (PDT) From: Felipe Contreras To: zsh-workers@zsh.org Cc: Peter Stephenson , Daniel Shahaf , Bart Schaefer , Felipe Contreras Subject: [PATCH v2 1/1] Increase default HISTSIZE to 1000 Date: Tue, 6 Sep 2022 14:50:03 -0500 Message-Id: <20220906195003.10408-2-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.37.2.351.g9bf691b78c.dirty In-Reply-To: <20220906195003.10408-1-felipe.contreras@gmail.com> References: <20220906195003.10408-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Seq: 50608 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: If the default is sensible then it's not necessary for the user to change it. Moreover, the FAQ is wrong: it says it's necessary to set HISTSIZE for the history to saved, but it isn't. HISTSIZE by default is 30 and that's enough to save the history, although not very useful. Therefore only *two* variables need to be set. This is even more clear after we remove HISTSIZE from the example, but then the text "The simplest possibility is to set it to the same as tt($HISTSIZE) as above" becomes problematic as the value of HISTSIZE is not readily available. The user doesn't need to know the value of HISTSIZE though, she can simply use $HISTSIZE instead. This has the advantage that if HISTSIZE is increased again in the future (as it probably should because most modern computers can easily afford orders of magnitude more), nobody needs to worry about SAVEHIST (neither in the FAQ, zsh-newuser-install, or existing zshrc files). Also, semantically makes more sense and carries less cognitive load. Signed-off-by: Felipe Contreras --- Etc/FAQ.yo | 17 +++++++---------- Functions/Newuser/zsh-newuser-install | 3 +-- StartupFiles/zshrc | 2 +- configure.ac | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Etc/FAQ.yo b/Etc/FAQ.yo index 8c795685a..4c058c363 100644 --- a/Etc/FAQ.yo +++ b/Etc/FAQ.yo @@ -1626,19 +1626,16 @@ work?) sect(Why is my history not being saved?) label(321) - In zsh, you need to set three variables to make sure your history is + In zsh, you need to set two variables to make sure your history is written out when the shell exits. For example, verb( - HISTSIZE=200 HISTFILE=~/.zsh_history - SAVEHIST=200 - ) - tt($HISTSIZE) tells the shell how many lines to keep internally, - tt($HISTFILE) tells it where to write the history, and tt($SAVEHIST), - the easiest one to forget, tells it how many to write out. The - simplest possibility is to set it to the same as tt($HISTSIZE) as - above. There are also various options affecting history; see the - manual. + SAVEHIST=$HISTSIZE + ) + tt($HISTFILE) tells the shell where to write the history, and tt($SAVEHIST) + tells it how many lines to write out. The simplest possibility is to set it + to the same as tt($HISTSIZE) as above. There are also various options + affecting history; see the manual. sect(How do I get a variable's value to be evaluated as another variable?) diff --git a/Functions/Newuser/zsh-newuser-install b/Functions/Newuser/zsh-newuser-install index 9e911d07c..46b1639c5 100644 --- a/Functions/Newuser/zsh-newuser-install +++ b/Functions/Newuser/zsh-newuser-install @@ -790,9 +790,8 @@ ${(F)unparsed} __zni_history_config() { __zni_apply_defaults -p \ - HISTSIZE 1000 "Number of lines of history kept within the shell." \ HISTFILE $zdmsg/.histfile "File where history is saved." \ - SAVEHIST 1000 "Number of lines of history to save to \$HISTFILE." + SAVEHIST \$HISTSIZE "Number of lines of history to save to \$HISTFILE." if __zni_display_and_edit "History configuration"; then install_state[history]="Unsaved changes" diff --git a/StartupFiles/zshrc b/StartupFiles/zshrc index d4e1d03cc..f8a0233bf 100644 --- a/StartupFiles/zshrc +++ b/StartupFiles/zshrc @@ -79,7 +79,7 @@ export HELPDIR=/usr/share/zsh/$ZSH_VERSION/help # directory for run-help functi unalias run-help && autoload -Uz run-help MAILCHECK=300 -HISTSIZE=200 +HISTSIZE=1000 DIRSTACKSIZE=20 # Watch for my friends diff --git a/configure.ac b/configure.ac index 890ef8dd2..6ca5c9189 100644 --- a/configure.ac +++ b/configure.ac @@ -3213,7 +3213,7 @@ AH_TOP([/***** begin user configuration section *****/ #define USE_SUSPENDED 1 /* The default history buffer size in lines */ -#define DEFAULT_HISTSIZE 30 +#define DEFAULT_HISTSIZE 1000 /* The default editor for the fc builtin */ #define DEFAULT_FCEDIT "vi" -- 2.37.2.351.g9bf691b78c.dirty