Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Rewrite of zsh-newuser-install



On 9 Feb 2021, at 15:41, Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
> More feedback welcome. :)

Thanks

> zmodload -F zsh/files b:zf_mkdir

afaik this module isn't guaranteed to be available. In most cases it will be,
but i've mentioned on here before my adventures with zsh on ipkg/opkg systems.
Then again, if you don't have the files module you probably don't have the
newuser module either, so it's *probably* fine...?

> setopt INC_APPEND_HISTORY_TIME
> setopt HIST_EXPIRE_DUPS_FIRST

No objections to these personally

> PS1='%F{magenta}%$(( [#10] .2 * COLUMNS ))>..>%n%f@%F{cyan}%M%f%>>:'
> PS1+='%B%F{blue}%$(( [#10] .2 * COLUMNS ))<..<%~%b%<< '

The %M (instead of %m) feels excessive. Ellipses have three dots, not two (see
below also)

> PS1+='%(?,%F{green},%F{black}%K{red})%#%f%k '

I like this, seems like a nice accessibility compromise

> RPS1=' %(1S,%S${SECONDS}s%s ,)%w %T'

Again the time stamp actually feels *less* useful with transient RPROMPT than
it already did to me, and i'm also not sure if the average user really wants
the execution time, but i'll go along with however the others feel (see below
also)

> setopt PROMPT_SUBST

I think most of the devs discourage PROMPT_SUBST. If nothing else it feels a
bit advanced for what we're trying to achieve here

> :zshrc:timer() { SECONDS=0 }

This function naming convention is OK with me. But i don't like the behaviour,
it renders the manual's explanation of SECONDS confusingly false and it will
cause problems for people who want to use it for timing other things

> # If $LS_COLORS hasn't been defined, try to generate it.

Again, is this our business? I'm OK with *using* LS_COLORS/dircolors when
available, but *setting* it? This is an environment variable for a third-party
tool. It's one thing for a distro packager to do it, but i'm not sure we as
shell devs should mess with it. Otherwise, why not set their GREP_COLORS and
whatever else too?

And if it's *not* our business, i think we should take care to avoid making it
appear set when it wasn't already. (I'm not sure if the recent 'declared null'
stuff impacts this, haven't updated in a bit, but in 5.8 `typeset -T` will
cause e.g. $+LS_COLORS to yield 1)

> zstyle ':completion:*' cache-path "$_zcachedir/compcache"

This should be $zcachedir, right?

> zf_mkdir -pm 0700 $zcachedir

I'm sure nobody will ever do ZDOTDIR=-foo but just in case we can probably add
the -- to these mkdirs. All the XDGBDS stuff makes sense to me otherwise

> setopt AUTO_CD ...

I know some of these cd settings are OMZ defaults. I'm ambivalent about most
of them, but i don't think i like CHASE_LINKS. It can cause people who are
used to the standard behaviour (used by other shells afaik?) to lose track of
where they are. But let's see what everyone else thinks

> unsetopt CASE_GLOB
> setopt EXTENDED_GLOB

I like NO_CASE_GLOB. I also personally like EXTENDED_GLOB, but i wonder if
others will object? It's actually not an OMZ default, i don't think, possibly
because it confuses bash converts

> setopt GLOB_DOTS

Don't like that, seems unexpected and risky

> setopt GLOB_STAR_SHORT
> setopt NUMERIC_GLOB_SORT

Ambivalent

> unsetopt CLOBBER

Mixed feelings. I know a lot of power users like this, and i see the appeal,
but it contradicts a lot of defaults and historical conventions

> unsetopt FLOW_CONTROL
> setopt INTERACTIVE_COMMENTS

I like these. Doubt the average user needs flow-control sequences, and
interactive comments matches the default bash and OMZ behaviour

dana





Messages sorted by: Reverse Date, Date, Thread, Author