bullet-train.zsh
bullet-train.zsh copied to clipboard
Feature right prompt
I add a simple build_rprompt function and two rprompt about user and host.
I think RPROMPT is suitable to place user and host these stable information while the PROMPT hold those info which change frequently. So I would advice you to remove the CONTEXT components.
Here is the demo.

I like the idea, #83 (vim mode marker) would work great with this. But I think there are few things we can improve.
- New line between PROMPT and RPROMPT Can we remove it? To have both of them on the same line. I would consider splitting them iff they would not fit in the same line.
- What is so right specific in
rprompt_hostandrprompt_userso they haverprefix? I guess they would work just fine as a left? I guess we can make all ofprompt_functions generic enough to be correct in left and right. It would combine beautifully with #115 Ability to reorder segments, as user could decide which segment he/she wants on left and which on right. - I am also not sure if keeping the state of leftness/rightness in
SEGMENT_SEPARATORis good idea. As you can seeprompt_segmenttakes the BG and FG as an input parameters an I guess we can pass also separator as parameter. But this would complicate the generic ability ofprompt_functions. Something to thing about.
@dawikur Sorry for my procrastination. Let me reply:
- New line between PROMPT and RPROMPT
Actually I do not add newline before RPROMPT explicitly, I do not know why is it below the line of PROMPT.
- What is so right specific in rprompt_host and rprompt_user so they have r prefix? I guess they would work just fine as a left?
You are right, I will remove the 'r' prefix later.
- I am also not sure if keeping the state of leftness/rightness in SEGMENT_SEPARATOR is good idea.
Personally, I would like to handle the state of leftness/rightness in SEGMENT_SEPARATOR, rather than change all prompt_ functions...
Isn't new line between Left and RIght from
[[ $BULLETTRAIN_PROMPT_SEPARATE_LINE == true ]] && PROMPT="$PROMPT$NEWLINE"
?
@acgtyrant #125 was merged, can you maybe use similar approach in your changes?
@acgtyrant Any update on this?
@dawikur Sorry, I will update in weekend...
I think it would be great if each segment can have $BULLETTRAIN_*_PLACE option.
for example
BULLETTRAIN_STATUS_PLACE='left' # or 0 - left; 1 - right
https://github.com/bhilburn/powerlevel9k may help for strategy. It looks good too.
Can we refresh this PR?
@acgtyrant can you update your PR to changes introduced in #188?