mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-10 04:54:03 -08:00
fix(battery): disable for WSL
charge_full_design and charge_full does not exists in WSL
This commit is contained in:
parent
b9916f559a
commit
632e495141
|
@ -6,6 +6,10 @@ sidebar_label: Battery
|
|||
|
||||
## What
|
||||
|
||||
:::caution
|
||||
The segment is not supported and automatically disabled on windows when WSL 1 is detected. Works fine with WSL 2.
|
||||
:::
|
||||
|
||||
Battery displays the remaining power percentage for your battery.
|
||||
|
||||
## Sample Configuration
|
||||
|
|
|
@ -32,6 +32,10 @@ func (b *Battery) Template() string {
|
|||
}
|
||||
|
||||
func (b *Battery) Enabled() bool {
|
||||
if !b.env.IsWsl2() {
|
||||
return false
|
||||
}
|
||||
|
||||
batteries, err := b.env.BatteryInfo()
|
||||
|
||||
if !b.enabledWhileError(err) {
|
||||
|
|
Loading…
Reference in a new issue