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

Re: Rewrite of zsh-newuser-install



On 9 Feb 2021, at 00:00, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> I feel about it a lot like I feel about POSIX compatibility.  Read
> into that as you will.

🤔

On 9 Feb 2021, at 00:00, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>> * I think the spec says applications should create the directories if they
>>   don't exist, right? So shouldn't we `mkdir -pm 0700` them (or the defaults)
>>   if necessary?
>
> Thanks for catching that, yes.

Actually i think the standard is referring to creating application
*sub-directories* under the base ones (e.g., $XDG_CACHE_HOME/zsh). I guess
that's the usual way to do it. But yeah, either way we'd probably need to
handle directory creation if we weren't going to just use ${ZDOTDIR:-$HOME}.

On 9 Feb 2021, at 00:00, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> setopt TRANSIENT_RPROMPT

I wonder if that makes the proposed RPROMPT more or less useful though. The
thinking behind it seemed like you'd have the time there as an historical
record, and if you made it transient you'd only have the time the last command
finished executing / the current prompt appeared. And if you're in screen/tmux
or a graphical terminal, you probably already have a clock, so....

On 9 Feb 2021, at 00:00, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> I was a little puzzled by "user names beginning with punctuation" but
> let it go at the time.

I actually do hide them myself, because macOS has a huge amount of
irrelevant-to-me system users with names like _timed and _hidd. I'm just not
sure if it's a good idea for every user on every platform.

btw: An improvement to the (Z)LS_COLORS stuff would be to source from
dircolors where available. Debian just do `eval "$(dircolors -b)"`, but that
overrides/exports LS_COLORS, and i'm not sure we want to be in the business of
screwing with parameters that don't belong to the shell. (Now that i think of
it, even just doing the LS_COLORS tie command could cause later profile
additions to falsely assume that LS_COLORS was set by the user.) Maybe
something like this (untested):

  typeset -T ZLS_COLORS zls_colors=( 'any defaults here' )
  if (( $+LS_COLORS )) || (( ! $+commands[dircolors] )); then
    typeset -T LS_COLORS ls_colors
    zls_colors+=( $ls_colors )
  else
    zls_colors+=( ${(s<:>):-"$(
      eval "$( dircolors -b )"; print -r - $LS_COLORS
    )"} )
  fi

Not sure if it's worth checking for gdircolors (Homebrew name), but that's a
thought too

dana





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