mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-12 14:04:05 -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
|
## 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.
|
Battery displays the remaining power percentage for your battery.
|
||||||
|
|
||||||
## Sample Configuration
|
## Sample Configuration
|
||||||
|
|
|
@ -32,6 +32,10 @@ func (b *Battery) Template() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Battery) Enabled() bool {
|
func (b *Battery) Enabled() bool {
|
||||||
|
if !b.env.IsWsl2() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
batteries, err := b.env.BatteryInfo()
|
batteries, err := b.env.BatteryInfo()
|
||||||
|
|
||||||
if !b.enabledWhileError(err) {
|
if !b.enabledWhileError(err) {
|
||||||
|
|
Loading…
Reference in a new issue