Unable to change color highlight in apt output
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Ubuntu Release:
lsb_release -rd
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Source package and version:
dpkg-query -W apt
apt 2.4.9
Binary apt command has support for color output on some commands such as "apt list <packagename>" Where enabled the default color output is unbolded green color. This is due to the apt configuration item, APT::Color:
Expectation:Setting the Highlight configuration option to another ANSI code should alter the apt output to the specified color code.
$ apt list apt -o apt::color:
What happens:
$ apt list apt -o apt::color:
Listing... Done
\x1b[31mapt/
\x1b[31mapt/
Prepends literal string of \x1b[31m instead of producing colored output.
"\033[31m" doesn't work either.
I think you need to url encode the sequence, but not sure. I don't think there's anything we can do here about handling backslashes, the problem is backspaces do happen in actual config items and we can't introduce a behavior change for them as that would cause regressions.
You should be free to also printf the actual special character into the config option or the command line argument.