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 11221 invoked from network); 6 Sep 2022 19:55:31 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Sep 2022 19:55:31 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1662494131; b=cG+9VSFX6K4iErS+cWNbcvOHOiQfHqT9Nb3UypyoU/KQK92yF01fE+s3CAQWzx00Tdq/ks/Mjm pbiSxtKyYeF3bIPp0Bey2Zz6wXLePak/czyhcZP2yB18VbLHOTkyS/jJVFnCIVn+mLFtKTrmBs aw9S4qldBeD5/T+4Ve5Gj/poePsxp77mjZRz+K5tXOCu6kNNgYz3D3NbdlOeXCZ6W5YfPM0RIX mdTYxiP1cRmaa+tcF53uoibsK8nLTCZket9tVKws+lUtOZWj8TAhxozQJTaTSCy8h0Qpfh3MJs 0pdwPYQi9XdJimYzG2uMJRCk4l14Qe1vmfnJQ3O+5mbieQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oa1-f49.google.com) smtp.remote-ip=209.85.160.49; 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=1662494131; bh=k7KpMiu7oX4z2nv2j9o9n0bAgHARhYDhRqu0K3NLlbc=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:MIME-Version:Message-ID:Date: Subject:Cc:To:From:DKIM-Signature:DKIM-Signature; b=Jvyf9Z89jxtksjR+0+BSLRZycABGDrkuPXKZ1zzcPzJMRLL9KFrDo8K98wwZufuwxexhe6RQzo Fjw0NJHJ2alNYE/0gVhXaop8qIfiuWE4Pquvft5YM6o4tAHoc5QxAkA4DbJJiGaQsf6xhGJ16N 7bLV1uLyOXQAHl5JfbnMZv7jBI2Lrqkx5gJVOmYGGd60m1buvmqLr5OkOyj9Eq8qfaOi460tq1 ZcA77f4D3D5u7zO0bneRajmfNQDjbGTxLTfbJbwdepCicDAUwv07IegAPy2ToAgjvJrfABSKyQ QKBBH+Q7AbHTsKFekB4V/SipcjJOurDPisRi0qNnjXftAg==; 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: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:In-Reply-To:References; bh=0R62QnA5xTUPeU3vD3OjefAoU41K46EmRBEwcIH6mc8=; b=j0o3nkO9QDq8s11uqwYhjLk6SW a+0aeipWpSC3flzUekMEeOiTxFHNKleoJggjm3ffr7sTjj5VPg2/eJJ5ztFMSUdPnc3tYCHafjbTQ oqeWH0xhsLmB8Rkgmq82P6i5I0F+vsljsmoG/bxrKEh0HeOR382avhyFWD1BPjYU/xjnyu7qrosx/ jFJtTF1bsqscwA0t8G3xkkMM3NvTlQoS+VLxc5gIXLT+JktzLZj2vdTN95pAgoaSpwOSCR9WHpkaF nH1NKRgHzgaT4WIwxcbe0Al+igXzXbyrfVImvyl5/I3a4FVwJ7Hl8ZS1HCbSx40puJpRJ7xRxmqqW ssX4bJxw==; Received: from authenticated user by zero.zsh.org with local id 1oVefR-000D1O-BZ; Tue, 06 Sep 2022 19:55:29 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oa1-f49.google.com) smtp.remote-ip=209.85.160.49; 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-f49.google.com ([209.85.160.49]:42961) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oVeaF-000CZq-OU; Tue, 06 Sep 2022 19:50:08 +0000 Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-127d10b4f19so5066755fac.9 for ; Tue, 06 Sep 2022 12:50:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=0R62QnA5xTUPeU3vD3OjefAoU41K46EmRBEwcIH6mc8=; b=XxamGOZV+ptaMjvbBUWGUWWcTGVdRf3kYnozE3DgTtVC5ynDOvORKAeT2wvc+NopZQ 48vlAL0HvXzARDfkQP2K2cprOPORjMm1Y09v7vODjiea7cJLp5z1Qe7Db3JIySUFmPXp QGPbhVoI1M7gq1ArtbvatXV7t9otKZJB6M2p2ueQXZacYiK9lAKyx9gdViqYGIJBq+ms 6RHkpGGjNAV8oPMd5Yrd2o26QDSBJ4eQ7oJ+TSAi2nb74U427ndxjFsvYzsFFawZ6DVT k3kWcPloBbwemPchHtR/SS3qu4vpvACUTI8mbQnfB8Wbu+UuhKbW0VLI8/5EMVBkGL3k 2SLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=0R62QnA5xTUPeU3vD3OjefAoU41K46EmRBEwcIH6mc8=; b=qfIISoL/42Uqg1JWptQRDm1ULV7cKtwgyw8Er3cVMAN/vg3xNITqbjTxrpu/n/UrDA DMO1GAfkS11OWLe8lgS/pu9l/7xlqHnox7bOcxkr61FQcb/K4uYO+A9rRTTn+TbC0DHJ gH3P2Jd2cL4/BVYZOSC5bRj9rrqTgBe8p5w6SZU9SnnDIPcJQkXS8v2HowRnKxIRghCg T4qzIKPXzh/Si1Ogk61fs849ntYvk37iBYWwIV0p2zEoK23zvR+wrEy5WG2VmidhGiX8 59AhIuDfxf47RJK7+qFo5BB84pB7oeaNOYG93M6jwPqkytNgDjvG+DcSPI1iri81B9rf daZw== X-Gm-Message-State: ACgBeo1How0aXUXtaSrB+xjqPMATI58Vvs7UaiXrpCh34vYA2m04w08K L7dmNDxDglCfxAk6F0DsSykOknSALbBVOA== X-Google-Smtp-Source: AA6agR4HTMASL1gmNwSSp7MhmrxC7NOLRCSAuTrf39EYKbyc2SWJJIDwfWjMhkxfskDu0QhrczZUZQ== X-Received: by 2002:a54:4795:0:b0:345:7d11:1cce with SMTP id o21-20020a544795000000b003457d111ccemr10013563oic.171.1662493806242; Tue, 06 Sep 2022 12:50:06 -0700 (PDT) Received: from localhost ([2806:2f0:4000:eec:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id 22-20020aca0916000000b00344adbc3492sm5712729oij.24.2022.09.06.12.50.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 12:50:05 -0700 (PDT) From: Felipe Contreras To: zsh-workers@zsh.org Cc: Peter Stephenson , Daniel Shahaf , Bart Schaefer , Felipe Contreras Subject: [PATCH v2 0/1] Useful default of HISTSIZE Date: Tue, 6 Sep 2022 14:50:02 -0500 Message-Id: <20220906195003.10408-1-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.37.2.351.g9bf691b78c.dirty MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Seq: 50607 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 we are going to recommend to most new users to set HISTSIZE to 1000, then it makes more sense to set that as default instead of 30. The less options we bother new users with, the better. We are not in 1990 anymore (when in fact the default was 128). Felipe Contreras (1): Increase default HISTSIZE to 1000 Etc/FAQ.yo | 17 +++++++---------- Functions/Newuser/zsh-newuser-install | 3 +-- StartupFiles/zshrc | 2 +- configure.ac | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) Range-diff against v1: 1: 95f64c276 < -: --------- Set SAVEHIST to $HISTSIZE by default 2: 747d23c8c ! 1: edef19cbd Increase default HISTSIZE to 1000 @@ Metadata ## Commit message ## Increase default HISTSIZE to 1000 - If the default is sensible it's not necessary for the user to change it. + 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: work?) verb( - HISTSIZE=200 HISTFILE=~/.zsh_history - SAVEHIST=$HISTSIZE - ) +- 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 @@ Functions/Newuser/zsh-newuser-install: ${(F)unparsed} __zni_apply_defaults -p \ - HISTSIZE 1000 "Number of lines of history kept within the shell." \ HISTFILE $zdmsg/.histfile "File where history is saved." \ - SAVEHIST \$HISTSIZE "Number of lines of history to save to \$HISTFILE." +- 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" ## StartupFiles/zshrc ## @@ StartupFiles/zshrc: export HELPDIR=/usr/share/zsh/$ZSH_VERSION/help # directory for run-help functi -- 2.37.2.351.g9bf691b78c.dirty