#1055674 lspower: outputs \e instead of ESC symbol if /bin/sh=bash

Package:
powermgmt-base
Source:
powermgmt-base
Submitter:
Dmitry Baryshkov
Date:
2025-11-01 17:17:02 UTC
Severity:
normal
Tags:
#1055674#5
Date:
2023-11-09 23:16:56 UTC
From:
To:
The lspower tool outputs \e instead of properly sending the ESC symbol.

Compare:

\e[0;1m✓ AC\e[0m
\e[0;32;1m+ BAT0 (98%)\e[0m
\e[0;1m✓ ucsi-source-psy-USBC000:001\e[0m
\e[0;1;30m✗ ucsi-source-psy-USBC000:002\e[0m

vs

✓ AC
+ BAT0 (98%)
✓ ucsi-source-psy-USBC000:001
✗ ucsi-source-psy-USBC000:002

The patch is attached.

#1055674#10
Date:
2025-11-01 17:15:01 UTC
From:
To:
This just happened to me when I ran lspower with bash instead of dash
and the reporter's trailer says /bin/sh = bash, which confirms this.