spaceship-prompt: Bad math expression
Issue
I get the following error
spaceship_battery:37: bad math expression: operator expected at `47'
Screenshot
Provide a screenshot that show your issue
Environment
Operating system: Ubuntu 16.04 LTS Terminal emulator: Terminator ZSH version: zsh 5.1.1 (x86_64-ubuntu-linux-gnu)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 33 (20 by maintainers)
Commits related to this issue
- Fix "bad math expression" for battery with UPS Fixes #245 `spaceship_battery:56: bad math expression: operator expected at '100'` if multiple battery statuses are reported (on macOS, at least). Happe... — committed to salmanulfarzy/spaceship-prompt by nomaed 6 years ago
- Fix "bad math expression" for battery with UPS Fixes #245 `spaceship_battery:56: bad math expression: operator expected at '100'` if multiple battery statuses are reported (on macOS, at least). Happe... — committed to zenjoy/spaceship-prompt by nomaed 6 years ago
Sure
I’m getting this error too now (
spaceship_battery:56: bad math expression: operator expected at '100') on macOS 10.14.1. That happened after I connected by device to a UPS.Basically
$battery_percentis100\n100I realize this is closed. But I wanted to comment for future me. Or others that google this. I am getting this and I am 99% certain it’s because I have two batteries. The number that is reported in the error message is the percentage from the second battery. If I new zsh more, I would submit a patch, but I don’t. I’m happy to help test if someone else wants to take a shot