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

Re: Rewrite of zsh-newuser-install

On Mon Apr 5, 2021 at 1:16 PM CDT, Daniel Shahaf wrote:
0. I recommend against reusing the name zsh-newuser-install for
a completely different thing. Names shouldn't be overloaded.

11. «print '\n'» prints _two_ newlines. That's too obscure for
educational code.

zsh-newusers-install is replacing the old zsh-newusers-install.
This isn't educational code like the rest of the files in the
repo are.

{1..4} {6..9}

+1 on all these.

5. what happens if the exec on the last line fails?

10. Should zrestart use «exec»?

(Addressed previously) zrestart doesn't use exec because it
could fail due to an error in the zshrc that wasn't caught
by the zsh -n line before.

That said, the same should apply to the newusers function.

12. Some settings seems like they could break the principle of least
surprise: e.g., FLOW_CONTROL, NUMERIC_GLOB_SORT, matcher 'b:-=+',
check-for-changes (as opposed to check-for-staged-changes).

- FLOW_CONTROL is unset by default, the line can be removed
- Not sure about NUMERIC_GLOB_SORT, do you have a surprising example?
- The 'b:-=+' is only prefixes, and only for the options tag. I would
actually almost prefer 'b:-=[^[:alnum:]]' to catch all kinds of obscure option styles programs use, make them discoverable from just typing '-'.
- (No comment on check-for-changes)

13. Recommend not to hide symbols from grep, as i

I agree, brace expansions make it hard to search.

14. Use of «bindkey -s … '^Q…'» seems questionable. As a way to inject
commands, it prints them to the tty and adds them to the history; that
doesn't seem elegant enough for example code that all new users would be
pointed to.

(Personally) I would rather directory changes being added to history.

It's also brittle in that it depends on ^Q not being
re-bindkey'd to anything else.

I can write a proper widget.

15. hjkl bindings for menu selection:

I type during menu selection, and users will be able to as well.
I think being able to type normally, except for a select few letters
would be confusing.

18. Show how to use terminal colours/attributes other than the basic
ones. E.g., I use ${terminfo[dim]} in some places.

We already 'autoload -Uz colors; colors', so $colors[faint] may be
preferred. Although it doesn't have \e[ like $terminfo[dim] does.

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