jD91mZM2 / powerline-rs

GitLab: https://gitlab.com/jD91mZM2/powerline-rs
MIT License
117 stars 22 forks source link

Support --newline ? #1

Closed esell closed 6 years ago

esell commented 6 years ago

First off, thanks for writing this! I'm typically a go person but am trying to wade into the rust waters :).

What would the level-of-effort be to add newline support? I think it would be a great feature, especially for those of us with smaller screens.

I'm a rust noobie but I will dig in and see if this is something that is fairly painless to implement, and if so, submit a PR. Experienced rust people might be able to beat me to it though...

jD91mZM2 commented 6 years ago

I don't really see the point of a newline switch because you can just execute echo afterwards. But then again, that's less efficient, so maybe you're right.

I'm a rust noobie but I will dig in and see if this is something that is fairly painless to implement

Awesome! Tell me if you change your mind and I'll do it :)

jD91mZM2 commented 6 years ago

Closed by #2!

jD91mZM2 commented 6 years ago

I was reminded by this issue after looking at #3, and I realized that I should probably ask: What shell are you on @esell? In both bash/zsh you'd assign the prompt to PS1, and because of shell substitution the newline gets lost. So in a way this is only usable in fish, which might not be optimal.

esell commented 6 years ago

Hey @jD91mZM2, I am a lowly bash user :)

jD91mZM2 commented 6 years ago

@esell And you're using --newline? Woah, how does that work? Could you please post your prompt initialization script? :)

esell commented 6 years ago

This is what I'm using in my .bash_profile

prompt() {
    PS1="$(powerline-rs2 --newline --shell bash $?)"
}
PROMPT_COMMAND=prompt

The powerline-rs2 is just a reference to my local copy that had these changes before they were merged in :)

jD91mZM2 commented 6 years ago

Oh, guess I was mistaken about --newline not working inside a subshell :stuck_out_tongue: Thanks for confirming :)