fix(logging): restore AUR progress bars and render clean colored logs #44

Merged
rootiest merged 5 commits from fix/aur-wrapper-pty-progress-bars into main 2026-06-12 03:02:21 +00:00

5 Commits

Author SHA1 Message Date
rootiest 499bf672f8 chore(gitignore): add python patterns to gitignore 2026-06-11 22:57:30 -04:00
rootiest 477a4ab265 fix(logging): render AUR progress animations to clean logs via terminal emulator
pacman/paru download progress is a multi-line terminal animation: it
repaints lines in place using ANSI cursor-movement (ESC[<n>A) and
erase-line (ESC[K) sequences, not just carriage returns. The previous
line-wise regex approaches could not reconstruct this — frames either
concatenated into one giant line (CR removed) or collapsed to blanks
(CR kept), discarding the final 100% frame.

Add scripts/clean_progress_log.py, a small dependency-free terminal
screen-buffer emulator that replays the cursor movements against an
in-memory grid and dumps the final static frame, preserving SGR color
so logs still render with color in ov/bat/less -R. It also drops the
script(1) header/footer.

Both wrappers now pipe the raw PTY capture through this cleaner (bumped
to version 5), falling back to stripping only the script(1) header when
python3 is unavailable. Document the scripts/ dir and mechanism in
AGENTS.md and docs/fish-config.md.
2026-06-11 22:48:02 -04:00
rootiest bd0eac8413 fix(logging): fix CR-collapse and script header filtering in AUR log post-processing
col -bp is designed for backspace-overstriking (man pages), not ANSI
terminal animations; it mangled escape sequences and garbled overprinted
progress bar text. Replace with a perl -ne one-liner that:
  1. Skips Script started/done header lines (next if matches, with -ne
     so next truly suppresses print, unlike -pe which still auto-prints)
  2. Strips trailing \r from PTY \r\n line endings
  3. Collapses CR-redrawn progress bar frames to their final state
  4. Preserves all ANSI color codes so ov renders them correctly
Bump wrapper version to 4 to force regeneration.
2026-06-11 22:23:38 -04:00
rootiest fc63b4f1b0 fix(logging): use col -bp to collapse progress bar redraws in AUR logs
script(1) captures every \r-redrawn frame of the pacman progress bar
as raw bytes. The previous sed pass only stripped ANSI codes, leaving
all intermediate frames concatenated in the log. col -bp semantically
replays the carriage-return overwrites and retains only the final state
of each line; the sed pass then strips residual ANSI codes and the
"Script started/done" header that script(1) writes to the file even
under -q. Bump wrapper version to 3.
2026-06-11 22:10:19 -04:00
rootiest 0cbb7c6892 fix(logging): run paru/yay wrappers in PTY to restore progress bars
Piping through tee caused libalpm to detect a non-TTY stdout and
suppress download progress bars. Switch to script(1) with -q -e -c
which allocates a pseudo-TTY so paru/yay see a real terminal, then
strip ANSI escape sequences from the captured log for readability.
Bump wrapper version to 2 to force regeneration on next shell start.
2026-06-11 22:02:56 -04:00