Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Rewrite of zsh-newuser-install
- X-seq: zsh-workers 47959
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Marlon Richert <marlon.richert@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Rewrite of zsh-newuser-install
- Date: Mon, 8 Feb 2021 17:42:12 -0800
- Archived-at: <https://zsh.org/workers/47959>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-02/CAH%2Bw%3D7bcxXr0jUSWceQL7KKiJAzju8KnMYwgJFWO0-15Hn_DRg%40mail.gmail.com>
- In-reply-to: <CAHLkEDur33X5s7Ar8n-9zQR0GqoZm3u_8rPRF3P-Jf=v90aLUA@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHLkEDv8KDW0iy+EtLXRgFOzgF1BbK5rEKjNBO-=NNUeKR9Xwg@mail.gmail.com> <0102017778f35f33-a962e4d3-83e9-4d3b-a0d7-45701bb40b11-000000@eu-west-1.amazonses.com> <CAHLkEDvL8+32tFQ1n6=SsaRMFQB3U2Di=6qpHtNBz8SkwzH7Zg@mail.gmail.com> <D6B297FA-044D-4F4E-8110-D6F4E2058EFE@larryv.me> <CAHLkEDvToxSvZWGMg7MKkFXjjWEefXW8e=gd+0e5RmuBLkVWEw@mail.gmail.com> <CAN=4vMqjYNtm3KSq47kC_2O4k3=hzF7qwN0sK9deCNgc2xK=kg@mail.gmail.com> <CAHLkEDvrcTdW2B3mxFAj8a7Wmfz-0KHGJkvi5hEdcCFSaP64NA@mail.gmail.com> <8BA25288-0FFB-4FF4-9799-541D6A3C52DA@dana.is> <CAHLkEDvWsv=hTHJ+70d1RQM7sH5_w94LYKhgrV2=vNMTchnx8w@mail.gmail.com> <CAHLkEDur33X5s7Ar8n-9zQR0GqoZm3u_8rPRF3P-Jf=v90aLUA@mail.gmail.com>
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author