puntonim / promptastic

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

Use strftime for displaying time #8

Closed LinuCC closed 9 years ago

LinuCC commented 9 years ago

This fixes the time looking awkward when at least one of the elements only displays one digit (for example, changes 6:9:7 to 06:09:07)

puntonim commented 9 years ago

Well, I actually did it on purpose. I often use a terminal window on a 13" display and not full screen, so the window's width is quite limited. Avoiding the 0-padding on the time segment, makes it look a bit awkward, but lets me make more room for other things (like the current dir path).

What if I add a setting in the main configuration file? Something like:

# If 0_PADDING_TIME is active, the time is shown in the form `hh:mm:ss`, eg.: 06:15:09.
# Otherwise the 0-padding is skipped, eg.: 6:15:9.
0_PADDING_TIME = True

What do you guys think? @LinuCC, @bertvv

PS: sorry for my late reaction, I was travelling

LinuCC commented 9 years ago

Sure, I like it. I just have not considered that it may be a feature ;)

puntonim commented 9 years ago

In the end I decided that your way is just the best way. I didn't even add the option in the config file, cause it doesn't make much sense. Thanks again for the contribution.