On Thu, Sep 24, 2026 at 01:00:36 +0000, [email protected] wrote:
> i upgraded from bookworm to trixie
> ran apt upgrade followed by apt dist-upgrade
> now i see escape sequences is some applications
> 
> $ apt show coreutils
> ESC[1mPackage: ESC[0mESC[32mcoreutilsESC[0m
> ESC[1mVersion:ESC[0m 9.7-3
> ESC[1mPriority:ESC[0m required
> ESC[1mEssential:ESC[0m yes
> ESC[1mSection:ESC[0m utils

This can be caused by having the LESS environment variable set to
a value that doesn't include "R".  apt runs less automatically when
stdout is a terminal, and apt tries to write colors automatically
under those same conditions.  If less isn't told to let the color
codes through untouched, you get the result you saw.

hobbit:~$ LESS=-X apt show coreutils 
ESC[1mPackage: ESC[0mESC[32mcoreutilsESC[0m
ESC[1mVersion:ESC[0m 9.7-3
ESC[1mPriority:ESC[0m required
...

hobbit:~$ LESS=-RX apt show coreutils 
Package: coreutils
Version: 9.7-3
Priority: required
...

hobbit:~$ (unset LESS; apt show coreutils)
Package: coreutils
Version: 9.7-3
Priority: required
...

You've got a few choices here:

1) You can ignore it.

2) You can include R in your $LESS expansion, if you're willing to risk it.

3) You can configure apt not to use colors by default.

4) You can set the PAGER variable to something other than less.

5) You can wrap the "apt" command in a function/alias that overrides
   the LESS or PAGER variable for this command only.

Etc.

Reply via email to