Skip to content

Checkupdates: Preserve pacman colors when printing the list of pending updates

Robin Candau requested to merge antiz/pacman-contrib:checkupdates_colors into master

The colors for the listing of pending updates are inherited from the "Color" option in /etc/pacman.conf (since it uses pacman -Qu to generate the list).

However, since the list is put into an array via a mapfile the colors are not preserved. Indeed, the "Color" option in /etc/pacman.conf correspond to the --color auto pacman flag which prints colors only when outputting onto in a TTY (which a mapfile/array is not 😅) and the lack of coloring seems confusing for users (see #117 (closed) & #1 (closed)).

This commit makes checkupdates forcing the use of --color always during the pacman -Qu command in the mapfile to generate the list of pending updates with colors for users that have the "Color" option enabled in the pacman.conf.

Edited by Robin Candau

Merge request reports