Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Rewrite of zsh-newuser-install
- X-seq: zsh-workers 47966
- From: Marlon Richert <marlon.richert@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Rewrite of zsh-newuser-install
- Date: Tue, 9 Feb 2021 10:17:50 +0200
- Archived-at: <https://zsh.org/workers/47966>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-02/CAHLkEDvKDQTr6ONwZE3qv5h2dgv0Kkj15PoaVG4kRFj01nKpcQ%40mail.gmail.com>
- In-reply-to: <CAH+w=7bcxXr0jUSWceQL7KKiJAzju8KnMYwgJFWO0-15Hn_DRg@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> <CAH+w=7bcxXr0jUSWceQL7KKiJAzju8KnMYwgJFWO0-15Hn_DRg@mail.gmail.com>
On Tue, Feb 9, 2021 at 3:42 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
Thanks for your suggestions! I will apply most of them; maybe even all
of them. I just have a couple of questions/remarks about some of them:
> %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 can change it, but I want to note that I happen to use macOS's
Terminal.app to ssh to an Ubuntu server, too, and it works fine for me
there.
> 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.
That's a nice trick. :) Here's my own PS4:
local dim=$'%{\e[02m%}'
typeset -gH PS4prv='foo'
typeset -gH PS4cur=$'\n%e %F{g}%N%f '${dim}$'%x\n'
PS4=$'%(?,,\t→ %F{r}%?%f\n)'
PS4+=$'${${${(%)PS4prv}:#${(%)PS4cur}}:+${PS4prv::=${(%)PS4cur}}}'
PS4+=${dim}$'%I%b\t%(1_,%F{y}%_%f ,)'
But I felt that was a bit too complex for new users. ;) The output is
very nice, though. :)
> 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.
If we don't put the terminal into application mode, then we cannot use
terminfo. Also, my takeaway from the sidebar was not that terminfo
isn't trustworthy; just that it doesn't account for _everything._ Not
using terminfo is even less trustworthy. If we don't put the terminal
into application mode, then from where are we going to get the key
codes we need? Plus, there doesn't appear to be any viable
alternatives to terminfo.
> Don't mess with Ctrl-U.
Why not? Control-U does backward-kill-line everywhere, except in Zsh.
It's annoying to get the whole line killed by Control-U _and_ not to
have a default key binding for backward-kill-line.
> 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.
I didn't make any such assumption. I use menu selection quite at
random; mostly when I cannot get what I want at the top of the list by
typing. Can you please explain how you came to that conclusion and how
my choice of menuselect bindings would impact your case?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author