puntonim / promptastic

A fantastic prompt for Bash
http://painl.es/promptastic/
Apache License 2.0
81 stars 16 forks source link

Change padding behavior for small windows + Add a third theme option #11

Closed andradei closed 9 years ago

andradei commented 9 years ago

Change 1

I don't if the current behavior of the padding was intended, but this is how it behaves on my OS X 10.10:

promptastic_current

If padding > cols the padding fills a second line entirely.

This is because padding dimension formula isn't working as intended. As a result, the condition if padding_len == cols is never met. This pull request fixes it and the behavior becomes like the image below:

promptastic_new

Notice that if padding_len > cols there is a wrapping effect (I don't know if that is intended).

Change 2

Add a third theme called contrast.py (used in the printscreens above) with minor changes to default.py

puntonim commented 9 years ago

Thanks for your contributions @andradei!

Promptastic groups all segments in 2 parts: a left-aligned one and a right-aligned one. The two parts are very clear in this screenshot: Promptastic screenshot

When the prompt line does not fit in a single line, a new one is used and the right and left alignment is kept, see this screenshot: ok

Your bc58861 introduces a different behavior which, to me, sounds not really user-friendly because the right alignment is lost in the new line: nok

So I would say the original behavior is more consistent, what do you think?

And as of d79f9c5 and 95d34f4, it seems to me that they void each other. So in the end only fc3a088 is a good commit, right? If so, could you please open a new PR with only fc3a088?

andradei commented 9 years ago

Thanks for considering this PR, my changes seem to have a different behavior on Linux than on OS X (where I tested the changes). The reason seems to be the way retina display MacBooks handle fonts.

I'll send the request with the commit you suggested.