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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28830 invoked from network); 9 Feb 2021 01:42:46 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 9 Feb 2021 01:42:46 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1612834966; b=lzwTyIxpyXx8/YQkMgw3QLYJg/EbFPnJOpnC5HpgVp0sqcvM5ZfVDqB6RX2BuJHYNw9HOefM+m W0VzuaemZO+MEFR/FNQ2bQGD7qAKScJ98xpj1LiriQmVHWM+JnOvOeexhBzVO5whpjH5vWz1SI hOVjuwO5xW8Y9xVmv0bWIfDx3+QwA6I6/tBnVgRvitYdvvTgZrs6WeF/W7qis50k0FdnF6GMsS DS2SL+vzubpmoA2mw8+xYemx1xhUTZVYBw2/iBEDm/qj/iZcpMCTNi3PMUhTUoN2Y0SIkIUkJQ H2AkLAyCoeuhH9+ecYU2SXbIAQmKmaxEYBI9uBZIjsn5UQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oi1-f181.google.com) smtp.remote-ip=209.85.167.181; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1612834966; bh=xT045rV6676KZekJXN/y+tueJoErG23ID+bZmqvPu1I=; 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=x/Bgxf/OWkFpa5N6LmHXSDPUKpSOrdxPrliG++XtyhOaPR6H1EAmDxaVAsezefWjAHcOud4RQ6 8QrhwNUrVx6yjhm3tcdG/SlXwqdUAP/8IfAaIhoIUoPyFBGgeonohJcD8OkJB09wcldPFZxN/J m1bdoZv1n3HKxrP1fwRPbbUP3uPk+r/gkdcSym32SlocJGAu7kV/dmCFlgmvXkY94WO4zeTLlV VJLX3YsfkhhHRUPzVXp3NbZGevGt7dGqEBc0xGjHEUXjHF8VUfN//CUpANehru21THWxkq+Fzh +GMqnmQbsfHjRkI7LWwyutB5dquM7uEIiu2agXCAoheZyg==; 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=eiPQ2UiZ5vMmdR4c5V+tK4gBcxdLTYRkUksZgdXNpzE=; b=HWk3YBj30t7H10VI6PYAIMc01K J6tzzgFJc/BI6TWXrq8Os4PpKzC6hcWGJK5xjwrwI7eM0pFK8FOcZOCjJ63y95iJ+4hGFuKioh1Pz /w5CLpe56eOKr0EFmLAByq/m1D5SQxMo+qAkzKIxAX5kUxvEHp347aCf4X7ZlYM9QIy4qUYXy4Ou5 lorO+ncYQP4Ip5SHaRT0vji5UcqDfrdtd4qRcuXrIrC/kycxDiQXdjdcIlSclA+XgnkfUhR61nBdB H865rR4yQne/7HFnO1CapUFp9CzD34SNtLgbwHOfwESI8S1c2c7zuiLtI6E1pEfABjPUnbgtN2y7R DxaVozPQ==; Received: from authenticated user by zero.zsh.org with local id 1l9I3A-000B5H-BE; Tue, 09 Feb 2021 01:42:44 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oi1-f181.google.com) smtp.remote-ip=209.85.167.181; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-oi1-f181.google.com ([209.85.167.181]:37394) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1l9I2q-000AwG-Q1; Tue, 09 Feb 2021 01:42:25 +0000 Received: by mail-oi1-f181.google.com with SMTP id y199so15790212oia.4 for ; Mon, 08 Feb 2021 17:42:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eiPQ2UiZ5vMmdR4c5V+tK4gBcxdLTYRkUksZgdXNpzE=; b=AXUz4+rcpuRLLCrTii0CWZnYxFo/dmx5VOjD2zqaLcOPBoDklHCWrcl1AHa22oc9UO MIgbmTsbF8hv5e4MsugUe7paerXx5xiGKz+oK3WI4/DOG1Jtbm8Ks21hrc2NHNkSQVQS 2Xlp+xkgik5NxVxs/7H9yRmEO07PIOTbXDyCv2v5e9QHbx1CRlGA3VLOmjBhQKtWMhff GNV1eslnH/gkAj51PFmpZaEsR3PKb/KyBqUOvdo9sgUo0If20QyeB/jFqENku8fX+pjI NN4YklN9usKhQvY5xO4BJlGGDmqydA/Ei/RdSQpMexpRJKhMZt4kFUNqNQBZdk4P9wqD poAg== 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=eiPQ2UiZ5vMmdR4c5V+tK4gBcxdLTYRkUksZgdXNpzE=; b=hMrEUIBkqJ/pJqT1D9kH+mn5QU6xce2r81PvKl40cB8e4OREUvZOHKaP+kBx4iZhm6 S01M5ejMHse1kWsLNQUGljeJIzunZ183NrpLSxWAwTmVF8XFc+Av7U4wK9ji8RPDBqNq 4+/ImidYGBYnmJgjuCRRrcuHkZ4cSkTwVSWSB5grQro0O5xJ83kzwIt0v8TbqiI6/NK/ JNnj8f9IAb6duBFh8EBPHpf3mZzYkz87kmI9Zu1YDp12t9CLEDjAzKCYNysqkqEDq+nb LJ/D4GsINUx+ALDAfR0foHyFvXwze6ycWfKyQV6Tbws+5nolF9icYOeuKvl8cYaCx156 WJMw== X-Gm-Message-State: AOAM532tdFR5c7nrFUy00FrHsuQtpsZv6gAV4lRMcJNjBfJhuVgl3ZP3 1jBXVRhDQmhj9AC5KGeY8QNlC7VJQGQ2ke5OsvnGwQ== X-Google-Smtp-Source: ABdhPJxoJZ+Bi52buUvf7v1o275VBbzDshO59anc7okP1cApBXlTxFBGpxJBCO8+wJDn0dA7ElBt91VSWse5dlTwi64= X-Received: by 2002:aca:3b8b:: with SMTP id i133mr1038638oia.132.1612834943363; Mon, 08 Feb 2021 17:42:23 -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> In-Reply-To: From: Bart Schaefer Date: Mon, 8 Feb 2021 17:42:12 -0800 Message-ID: Subject: Re: Rewrite of zsh-newuser-install To: Marlon Richert Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 47959 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: Generally speaking not bad. Thanks for the sample. More detailed commentary: > HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history # File in which to save history I've seen/used this as ".zhistory" for decades, but that's not actually coded anywhere except in the "c2z" example, I guess. I find the underscore annoying since none of the other startup files have one, though I understand the objection to doubling the "h". > setopt HIST_IGNORE_ALL_DUPS # Ensure all history items are unique. I'd go with just HIST_IGNORE_DUPS rather than ALL, and as for these: > setopt HIST_REDUCE_BLANKS # Remove insignificant whitespace. > setopt SHARE_HISTORY # All simultaneous sessions use the same history. I agree with Lawrence, these are too intrusive. SHARE_HISTORY makes me crazy unless some sort of directory-local-history is also in use, especially if the home directory is NFS mounted or the like. A bunch of stuff about prompts: Prompt colors are going to be a matter of taste; if you're going to apply them then you have to pick a color scheme that's visible on either a light or a dark background, since zsh doesn't control that terminal state. I have a white background and the yellow text in RPS2 is almost unreadable. %F{8} and %F{12} do nothing on my terminal (ssh in Terminal.app from Mac to Ubuntu, in this case), they just emit the same as %F{default}, so I don't know what you're after with those. Don't use numerics. I don't like the leading blank line in the prompt, either, but it's not a showstopper. Isn't coloring the prompt sufficient visual differentiation? I don't have a strong opinion about the PS4 prompt, but here's mine: PS4=": %1N:%i%1(_.:%_.); " This makes the prompt string into a ":" command ending at ";" so most of the time you can copy-paste the PS4 output directly back to the PS1 input and hit enter to run it. Same trick used in $HISTFILE for extended history. Putting extra newlines and characters like ">" in PS4 make that impossible. RE completion styles: Again with the %F{8}, just to call it out. Mostly good otherwise, just some random grumbling: In the completer style, _history with 12000 lines of context does not give me warm fuzzies. In matcher-list, I waver back and forth on using [:punct:] instead of something more specific like [-_,.] (which is what I've used for years). I'm not a fan of the case-insensitive sorting attempt. > unsetopt AUTO_PARAM_SLASH # Don't add trailing slashes to dir completions. Why? The comment isn't very clear either, since it's not "dir completions" it's $foo where the expansion of $foo gives the name of a directory. It seems weird to do this when later on you have > setopt AUTO_NAME_DIRS which I would recommend against (although not strongly). RE key bindings/line-init: Wasn't there a sidebar into why terminfo isn't trustworthy? In any case, application mode is exactly the opposite of how I want my shell behaving, unless I'm misinterpreting your code. Don't mess with Ctrl-U. I'm not sure I like your choices for Enter / Alt-Enter in menuselect, because it seems to presume that the most common case is to do menu-selection on the last word being entered for a command ... but my experience is that I'm more often using menu-selection on the set of command-line options, which typically have to be followed by additional arguments.