Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow color switching intra-PS1 #18

Open
nicowilliams opened this issue Aug 14, 2013 · 10 comments
Open

Allow color switching intra-PS1 #18

nicowilliams opened this issue Aug 14, 2013 · 10 comments

Comments

@nicowilliams
Copy link

Like I do for my own. Just allow the color selections to get dragged into the PS1 box. This makes it easy to color branch and path names (for example) differently, so they stand out.

@Likeyn
Copy link

Likeyn commented Aug 14, 2013

+1

@xta
Copy link
Owner

xta commented Aug 15, 2013

Thanks for providing feedback. This feature would be helpful, but it would be very important to preserve the ease of use in the UI controls.

@Likeyn
Copy link

Likeyn commented Aug 15, 2013

Okay, what about a two step process then? The current color generator would create a box depending on which {fore,back}ground color you selected, which you could then drag into the configuration box to apply it.

Note that a "color reset" box would be probably needed as well.

@xta
Copy link
Owner

xta commented Aug 15, 2013

@Likeyn That would be one way to do it. I am concerned about having another step in the process and finding the right balance between ease of use and power features. There are many excellent color options that HalloweenBash does not handle at the moment; for many reasons including 1.) color controls are tricky to implement, 2.) a user should not feel overwhelmed with decisions to make and steps to take.

@nicowilliams
Copy link
Author

You already handle all other elements the way I propose you handle color:
as boxes to drag around, so UI-wise there's no complication. Just make
sure to reset the colors automatically at the end of the prompt.

@xta
Copy link
Owner

xta commented Aug 16, 2013

@nicowilliams, picking multiple colors is a useful feature, but there are a lot of specific implementation details that remain unanswered.

Should you send a pull request, I'd be happy to review it. Thanks

@nicowilliams
Copy link
Author

It's just a suggestion. I already have my own fairly hairy PS1 setup the
way I want, including switching to different PS1s depending on whether $PWD
is inside a git/hg/fossil workspace, and I'm not going to switch, so no PR
from me (sorry). But it is nice to play with other possibilities using
your HalloweenBash, and other users may find it very helpful. I'll stop
making noise now :)

@kevinSuttle
Copy link

I was also wondering about this. Even without the --no-color flag, everything still comes up in bash as the default foreground color.

For example:

function parse_git_branch {
   git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}

export PS1="\w \$(parse_git_branch) \@\n$ "

screen shot 2013-10-04 at 9 57 52 am

@xta
Copy link
Owner

xta commented Oct 31, 2013

Hi @kevinSuttle,

Are you referring to switching colors between different elements? Your example adds the current git branch.

Thanks for your feedback

@kevinSuttle
Copy link

@xta, yes. Switching between elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants