Closed AndydeCleyre closed 3 years ago
This looks like a fine idea. I'm sorry that it has taken me so long to review it. Give me a few days to play around with it.
We might ultimately want to call the variable AGKOZAK_PROMPT_DIRTRIM_STR
or something like that, since it can be as long as the user wants. Let me think about that.
Out of curiosity, what symbols do you like to use instead of ...
? Thanks!
We might ultimately want to call the variable
AGKOZAK_PROMPT_DIRTRIM_STR
or something like that, since it can be as long as the
Maybe AGKOZAK_PROMPT_DIRTRIM_CHARS
, even. I think we've already got options like that. I'll keep thinking about this.
OK. I've merged your new feature to my own branch feature/ellipsis-dirtrim
, but I've made a few changes.
The most important one is that I've named the variable AGKOZAK_PROMPT_DIRTRIM_STRING
, but it works the same.
I prefer to keep changes to _agkozak_prompt_dirtrim
minimal -- no new mandatory parameter. Some people may be invoking that function in their custom prompts, and I don't want their code to break.
Give my branch a pull and test it to make sure I haven't missed anything.
Thanks! It's working great.
Yeah, I only used CHAR
in the name in an attempt to mimic AGKOZAK_PROMPT_CHAR
, even though that's an array.
For now I'm using the ellipsis character (…
) instead of three periods. I may change it, but my primary goal is to keep that to a single character.
For now I'm using the ellipsis character (…) instead of three periods. I may change it, but my primary goal is to keep that to a single character.
Ah, that makes sense. It takes up less space on the screen, doesn't it?
Give me a few days and I'll let you know when I merge this feature to master
. Thanks so much for your contribution.
Yeah, just saves two character spots for me. It doesn't look amazing with my font setup, so I might play with alternative characters if I can find any that make sense and look better.
Thanks for your continued, excellent Zsh work.
I'll add your example:
AGKOZAK_PROMPT_DIRTRIM_STRING=$'\u2026'
(Unicode ellipsis) to the documentation. I think people will like that.
All right -- your feature is now on master
and is part of release v3.9.0. Thanks again for your contribution.
_agkozak_prompt_dirtrim now takes this value as argument 3 (second mandatory argument)
Add variable with default value to the environment (if unset)
Update docs in comments accordingly
Functions using the new global variable now include an annotation saying as much
NOTE: The default can be overridden with an empty string value; default value '...' is only used when the variable is unset
README: