bullet-train.zsh icon indicating copy to clipboard operation
bullet-train.zsh copied to clipboard

Feature right prompt

Open acgtyrant opened this issue 9 years ago • 9 comments

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.

1456834180

acgtyrant avatar Mar 01 '16 12:03 acgtyrant

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_host and rprompt_user so they have r prefix? I guess they would work just fine as a left? I guess we can make all of prompt_ 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_SEPARATOR is good idea. As you can see prompt_segment takes 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 of prompt_ functions. Something to thing about.

dawikur avatar Mar 21 '16 19:03 dawikur

@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...

acgtyrant avatar Mar 27 '16 07:03 acgtyrant

Isn't new line between Left and RIght from [[ $BULLETTRAIN_PROMPT_SEPARATE_LINE == true ]] && PROMPT="$PROMPT$NEWLINE" ?

dawikur avatar Apr 07 '16 17:04 dawikur

@acgtyrant #125 was merged, can you maybe use similar approach in your changes?

dawikur avatar Apr 10 '16 17:04 dawikur

@acgtyrant Any update on this?

dawikur avatar Apr 21 '16 15:04 dawikur

@dawikur Sorry, I will update in weekend...

acgtyrant avatar Apr 21 '16 15:04 acgtyrant

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.

tunnckoCore avatar May 22 '16 14:05 tunnckoCore

Can we refresh this PR?

dawikur avatar Jan 02 '17 17:01 dawikur

@acgtyrant can you update your PR to changes introduced in #188?

dawikur avatar Jan 13 '17 18:01 dawikur