[pacman-dev] [PATCH] Hide cursor while pacman is running

Allan McRae allan at archlinux.org
Thu Mar 5 06:07:46 UTC 2020


On 5/3/20 6:56 am, Anatol Pomozov wrote:
> Use ASCII control codes to hide cursor at the pacman start and then
> show the cursor when pacman finishes.
> 
> It helps to avoid annoying blinking when progress bars are re-drawn.
> 
> Cursor is reenabled if pacman expects user's input.
> 

Some issues:

> sudo ./src/pacman/pacman -Suw
:: Starting full system upgrade...
:: Replace bzr with extra/breezy? [Y/n]
resolving dependencies...
warning: dependency cycle detected:
warning: libglvnd will be installed before its mesa dependency
?25l
Packages (204) alsa-lib-1.2.2-1  alsa-plugins-1.2.2-1

A rogue "?25l" there.  I also get a lot of flickering of the cursor at
"resolving dependencies" after this patch (which is not present before).

Also,

util-common.c: In function ‘console_hide_cursor’:
util-common.c:110:10: warning: non-ISO-standard escape sequence, '\e'
  110 |   printf("\e[?25l");
      |          ^~~~~~~~~

(and two other places)

\e is a GNU shortcut.  Use \x1B instead.


More information about the pacman-dev mailing list