[pacman-dev] Broken pacman output when resizing

Constantin Weißer i7c at posteo.de
Sun Nov 29 12:14:46 UTC 2015


Hi there!

As probably everyone noticed one time or the other, pacman output (in
particular progress bars) breaks whenever one resizes the terminal,
which leads to scrambled output like this:

https://paste.xinu.at/LNo/plain

This is due to the fact, that pacman always claims the whole terminal
width.  Whenever one runs pacman in tmux (split pane) or uses a tiling
wm, resizing happens quite often and will produce such broken output.

Considering the output closely, we have quite some "uninteresting"
information there. All the 100% progress bars are actually redundant as
pacman does not continue installation (or download) if it cannot
retrieve a package.  Also, it only downloads one package at a time, so
we only really care about the progress of the last package (or total
progress). I thus propose a different output:

https://paste.xinu.at/m-5XEa/

version1 uses a fixed 100 columns output, version2 a fixed 80 columns
output. In version1 it is possible to draw the per package progress at
the same line as the package name. When complete, only the package name
remains.
In both versions the currently downloaded package is always
the last line of the output. Both proposals contain an example for per
package and total progress.  I'm personally in favour of version2,
because it seems safe to assume that we always have 80 cols available
and it also unifies the output style for both per package and total
progress.

To sum up the changes shown in the mockups, I propose:

* progress bars of database synchronising, download and installation
  move on line below compared with the current output
* when a step is complete, the line with the package (or step) name
  remains, but without any width-dependent progress bars. For download,
  you find and example in the link above.  For installation a finished
  steop could look like this:

  (26/63) upgrading opus

  So basically just the redundant progress bar is removed here.

* The output is limited to 80 columns which should fit nicely as seen in
  the example.
* Other output (such as warnings, errors, new optional deps, ...)
  remains the same.

Is there any interest for such a change? If so, I could develop and
provide a patch. I'm also happy about comments, fine-tuning and further
improvements to the proposal.

--
Constantin


More information about the pacman-dev mailing list