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, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23616 invoked from network); 12 Feb 2021 06:00:19 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Feb 2021 06:00:19 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1613109619; b=cA/e0uo36yub5NppBN53/V/2qHw5uA8wRxAcf8Nx1LjD2Z7dap3lbNV5arJPdCxLbmpO/rUFdU e9xzJgjoCVH5ivJPlPloK+UVnrKM1+wkZv3lIYpK5tW0Z2flHf3+j5lgynRiw0sMtQabLzgOeB QtSakmP/iefis010PIpqfDSdb1b/IlAVgqvtcc8u223fngJWB8ox1atDaNVVV5KMSPA++LZ5jF pnvhNYxjJHx8ags7thGti5FzrTzs/cNqATk8AHs6oQT+0MZPk81L5P+HeRLydCQiffonMyT9GO hgECAT0yl9Y1kDtoL71mLAxML9rcMG61fb/F5rRs5dhUzA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-il1-f182.google.com) smtp.remote-ip=209.85.166.182; dkim=pass header.d=gmail.com header.s=20161025 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-20200801; t=1613109619; bh=Nrot4ANX/OTfLhrzTFVoRl25U26dTljplADCE/5cDUc=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=DBoMS8SpraaYhp8hTVUxgfbgg3h27k1byj5Vlt+oxSS5hZbe3cb+H/oXeRI792fAI5G7lTwvKR XJ0V/a587zF4yf5aIyhvQvlP6oGx52+O/MTzkvWwGbv7rgVV95M8386pUf+MkfVq+3qz6CdE1Q tFmNNqFbPPoPAXlfYD7q3dWDSSD9wpKVAxXsmhQKMBkXhqEP3fs8fi2s/Z7eaH9teahn3EQwUx Dda+0P7WVsYcbCPkuu+ua+lt6pmQlUS3GOYEEoMK3TRCytF5tMoQH2W5Ek6ZlPiijLOqUm/F3j wptdH9qlcfFL5w50NrcigQr3/j6IeDbNG6wNXBKbpcBucA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=LPyRRsp7gW6fqadG0KhHCPpenT1eDqx/IJjWv3PTH5k=; b=UyuXDD9FMQukbqmez/8pCUVzvD j9Z+wefmSsmi7rJcgJLpWQuHrDxWV9gAJJD62qUiLaQcsegTXFge9qY8Ol8yrYdDIPIIdRFTKLuNR pNSl/ZhFjnwHDNk0+qiy7gMVKAS1PpP4wXWUgbP76R9bSxT66uqB/mvQB4yL4nSzz4u7r6en9yuPo Ahl4bko4yEioTn8vfyDWnfeNd5HzwihDvK/iaT63Y80IB/BkfxoYaLd/2XEjILQOx9gO88fID9pDt vS69jqq8ew1wkDqLbgLa9L8knWdLIwdS01l347vnM/CGJzuc7mTDtlV9h5rbfIiVR7HS9eBDpkmrn vwe7pkDA==; Received: from authenticated user by zero.zsh.org with local id 1lARV1-000HUa-MJ; Fri, 12 Feb 2021 06:00:15 +0000 Authentication-Results: zsh.org; iprev=pass (mail-il1-f182.google.com) smtp.remote-ip=209.85.166.182; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-il1-f182.google.com ([209.85.166.182]:38603) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lARUp-000HHK-Tm; Fri, 12 Feb 2021 06:00:05 +0000 Received: by mail-il1-f182.google.com with SMTP id a16so7299045ilq.5 for ; Thu, 11 Feb 2021 22:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LPyRRsp7gW6fqadG0KhHCPpenT1eDqx/IJjWv3PTH5k=; b=Ou9DadAyn2CQiPJYzR3s1TJeJqBd136+IM6agOLwRkQUyQmGNpBn1iFNG+15o+JM9x skCvB4DQW4oT1cQqtYPU+UjEwoZoSwdPUgfkeoNUmGhyWpg1BRmCynnRGo5coDhuofn6 TPnubXW5NcJR3TC/a1mn8C3diT/ZAN8+7AXyMHRaVjWnQ3xs8L7hw7SDaGYn6Iv8ARu6 zslV3lgc70w0bY3JLh67AVTa/H/lCeLVgWbc7AdJxkJcxvr5hxLCG3ailqqGKf2ZJvfT qvVbBF9v7UgGRY6hhQ4v3gTfy1izkIkBBgi5eclIt8Tv/gbzlOUC8fab3/2MlY8HI0/d 2+gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LPyRRsp7gW6fqadG0KhHCPpenT1eDqx/IJjWv3PTH5k=; b=HOmjCs/W80phVy5iac8qPCQeQ7KWn/U6BqqIQnCuTlM52QidVt1800cEbmSyMF4ViF KxQOfeL6Rt41noPjkQnpwGaRN2ZXtwL06pl4ZZZFqviKX5l2bV0BkCn9HqOvZ/uNfCei UcFPKDclJbN0TRFIJqxv10i0R1T0i4l7NwjHrvpDuXAc+ShGzLTgxOKHPyeWY1sU8Jzl s2pJdHGrgev0+is11JoqiDJmioNpc0C69DF0vWTjpcYe5MEsuesGIe3U2EW+kO8EeLPV ++MW0WDa6jJ08BzJKoq7zsWY+KIabcbtE9kAmetxebwFjccxYni793seiX8qxm2t8tyt fqXA== X-Gm-Message-State: AOAM531crpuCvou+PGR+GmGTlQ/Har7dUmYR0LP9qRiX5ZgraJHUwUly 44pWJBkOO6hJ5st0pglS1tWpVBNoHSTjixC0IQE= X-Google-Smtp-Source: ABdhPJyf45dIw+RDcckQw0O3tVTAI/BPJCYjtrdfKzacy4BRW8+htaJ0XeFLTRHXHyuLVXAGT5Vzq1R6XzV9ImZXQBE= X-Received: by 2002:a05:6e02:1347:: with SMTP id k7mr1273371ilr.168.1613109602758; Thu, 11 Feb 2021 22:00:02 -0800 (PST) MIME-Version: 1.0 References: <0102017778f35f33-a962e4d3-83e9-4d3b-a0d7-45701bb40b11-000000@eu-west-1.amazonses.com> <8BA25288-0FFB-4FF4-9799-541D6A3C52DA@dana.is> <19996A10-103F-4054-AD57-FCED8E406687@dana.is> <86782FA5-6EBB-4FCD-90AD-D33F352455F1@dana.is> <5C018E61-8E72-4647-8A53-0F9D5BB82146@dana.is> In-Reply-To: From: Roman Perepelitsa Date: Fri, 12 Feb 2021 06:59:51 +0100 Message-ID: Subject: Re: Rewrite of zsh-newuser-install To: Bart Schaefer Cc: Marlon Richert , dana , Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 48010 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: Archived-At: On Fri, Feb 12, 2021 at 1:10 AM Bart Schaefer wrote: > > On Tue, Feb 9, 2021 at 10:58 PM Marlon Richert wrote: > > > [RE prompt truncation] > > > > Would using the actual ellipsis character be OK? Or do we have to > > stick to ASCII? > > We probably have to aim at lower-capability terminals. I suppose it > might make sense to check [[ -o multibyte ]] and assume the terminal > could handle the ellipsis if so, but how would multibyte become set? > In the /etc/ files? There is no straightforward way to check whether the terminal can display a specific unicode character (e.g., the ellipsis). Even if there was, and even if the check was simple, the benefits wouldn't be high enough to justify the extra complexity in the default zshrc. > I'm surprised we haven't heard from Roman about this, given the > content of that reddit thread he linked back at the start of this. I stopped commenting on this once I realized that my vision of what the default zshrc should include is very different from everyone else's here. In my view only the crucial things must be included. How much is gained from defining PS2 and PS4? I think not much. I'd remove them without second thoughts. Or consider history setup: HISTFILE=${ZDOTDIR:-${XDG_DATA_HOME:-$HOME/.local/share}/zsh}/history if [[ ! -d $HISTFILE:h ]]; then zmodload -F zsh/files b:zf_mkdir zf_mkdir -pm 0700 - $HISTFILE:h fi SAVEHIST=10000 HISTSIZE=$(( 1.2 * SAVEHIST )) setopt EXTENDED_HISTORY setopt INC_APPEND_HISTORY_TIME setopt HIST_EXPIRE_DUPS_FIRST setopt HIST_IGNORE_DUPS I'd replace it with this: HISTFILE=~/.zsh_history # store command history in this file SAVEHIST=100000 # store at most this many commands in the file HISTSIZE=100000 # store at most this many commands in memory Perhaps ${ZDOTDIR:-${XDG_DATA_HOME:-$HOME/.local/share}/zsh}/history is better than ~/.zsh_history (I don't know if it is) but it's so much more complex. Ditto for all the pet peeve options and arithmetic expansions. As far as prompt goes, I'd leave only PS1. No right prompt. The only non-default option I would use is INTERACTIVE_COMMENTS. This is important to allow people to copy-paste code from StackOverflow and the like. The amount of complexity brought in by the bindings is very high. If the delete/home/end keys don't work, it's a disaster. On the other hand, the binding for `redo` can be removed without anyone noticing or complaining. As I mentioned earlier, I wouldn't use terminfo. It makes the config more complex for little to no benefit. It also breaks bindings when there is no terminfo definition for $TERM. This happens when using a terminal with exotic terminfo (e.g., alacritty, xterm-kitty, or tmux-256color) and connecting to another machine over ssh. In my opinion the default config shouldn't aim to provide the best solution to anything: the best history setup, the best prompt, etc. It should make zsh usable by someone who considers bash usable out of the box (e.g., on Debian) but other than that be as simple and as short as possible. Experienced zsh users are welcome to share more elaborate and opinionated configs through other channels. Roman.