Spaceship-prompt: What does the '.%' in the prompt mean?

Created on 24 Aug 2017  Â·  12Comments  Â·  Source: denysdovhan/spaceship-prompt

What does the .% before the prompt mean? can I customize/remove it?
image

Environment

Operating system: Windows 10
Terminal emulator: zsh/oh-my-zsh
ZSH version: 5.1.1

bug

Most helpful comment

It's from [battery] section, Showing fully charged battery status. Also supposed to show the battery level (hence the %) . You could disable it by defining a custom prompt order.

Battery section is shown only if you have either pmset, upower or acpi. I haven't tested it on window machine. Could you share more info about this bug ?

All 12 comments

It's from [battery] section, Showing fully charged battery status. Also supposed to show the battery level (hence the %) . You could disable it by defining a custom prompt order.

Battery section is shown only if you have either pmset, upower or acpi. I haven't tested it on window machine. Could you share more info about this bug ?

@salmanulfarzy Aha, I am running on a laptop with battery power though, and it's not changing.
I'm on a Dell XPS 13, Windows 10, running zsh with oh-my-zsh on Hyper.

Could you share the minimal output related to battery section from setopt xtrace verbose ?

Hmm, there's a lot of output. How can I filter it?

Copy paste section related to battery. That would be enough.

+spaceship_battery:22> _exists acpi
+_exists:1> command -v acpi
+spaceship_battery:32> battery_percent=+spaceship_battery:32> echo
+spaceship_battery:32> battery_percent=+spaceship_battery:32> tr -d '%[,;]'
+spaceship_battery:32> battery_percent=''
+spaceship_battery:35> [[ '' == 100 || $battery_status -regex-match "(charged|full)" ]]
+spaceship_battery:37> [[ '' -lt 10 ]]
+spaceship_battery:38> battery_color=red
+spaceship_battery:44> [[ '' == charging ]]
+spaceship_battery:46> [[ $battery_status -regex-match "^[dD]ischarg.*" ]]
+spaceship_battery:49> battery_symbol=•
+spaceship_battery:53> [[ false == true || '' -lt 10 ]]
+spaceship_battery:54> _prompt_section red '' •%% ' '

Edit: Format code block

Looks like the acpi returns empty string, Section should've exited with an empty string.
https://github.com/denysdovhan/spaceship-zsh-theme/blob/222321e435e727631b5f966815203d365d99a588/spaceship.zsh#L1059-L1064
@Mohamed3on What's your output for acpi -b ?

acpi is not recognized.

Could spaceship check the presence of a BAT{n} directory in the /sys/class/power_supply/ path instead of looking for installed packages?

EDIT: I guess this would only be fitting for linux (and maybe OSX) machines?

@salmanulfarzy is this issue still relevant? #296 is marked as duplicate and it's closed. Please, close this one too, if necessary.

Here battery section was displayed even if none of pmset, upower or acpi were available. Kept it open to resolve that.

@salmanulfarzy I've fixed that in #148

https://github.com/denysdovhan/spaceship-zsh-theme/blob/313644e70edf88427b5c1ad86ceda160988c50f5/sections/battery.zsh#L56-L58

@Mohamed3on is 3.0 fixes your issue?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

doole picture doole  Â·  4Comments

JounQin picture JounQin  Â·  3Comments

xhaythemx picture xhaythemx  Â·  3Comments

salmanulfarzy picture salmanulfarzy  Â·  3Comments

vburojevic picture vburojevic  Â·  3Comments