Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Rewrite of zsh-newuser-install
On Tue, Feb 9, 2021 at 10:58 PM Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
>
[RE prompt truncation]
>
> Would using the actual ellipsis character be OK? Or do we have to
> stick to ASCII?
We probably have to aim at lower-capability terminals. I suppose it
might make sense to check [[ -o multibyte ]] and assume the terminal
could handle the ellipsis if so, but how would multibyte become set?
In the /etc/ files?
> > > 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
>
> Why exactly do you discourage the use of PROMPT_SUBST? Why is it a problem?
Here's one reason:
zsh% P='${(%%)P}'
zsh% setopt promptsubst
zsh% print -P $P
zsh: segmentation fault (core dumped) Src/zsh -f
Do that accidentally once with PS1 or RPS1, and you're locked out of your shell.
The main thing, though, is that it encourages the prompt to contain
$(fork something expensive). If you have to think about when/where
you're capturing that output, you write better code.
(From another message)
> When using $PROMPT_SUBST, the prompt will automatically adapt when I
> resize my terminal window.
Granted. It would be nice if the character-counting ability of
%(l.t.f) could be used in the numeric argument of %>x> and %<y<.
"prompt bart" gets around this with a TRAPWINCH, but that's out of
scope for this.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author