Skip to content

batpipe: Use one viewer list on all systems - #154

Open
zsltg wants to merge 2 commits into
eth-p:masterfrom
zsltg:fix/batpipe-viewer-list
Open

zsltg wants to merge 2 commits into
eth-p:masterfrom
zsltg:fix/batpipe-viewer-list

Conversation

@zsltg

@zsltg zsltg commented Sep 30, 2026

Copy link
Copy Markdown

Fixes #153.

Change

batpipe selected one of two viewer lists with an inverted command -v eza check. This change replaces the two lists with one list:

BATPIPE_VIEWERS=("eza" "exa" "ls" "tar" "tar_gz" "tar_bz2" "unzip" "gunzip" "xz")

The change keeps the intent of the two earlier changes:

Tests

The second commit adds three tests to test/suite/batpipe.sh and two small archives to test/data:

  • viewer_tar_gz and viewer_tar_bz2 open a file inside a .tgz and a .tbz archive. Each test runs once with the current PATH and once with an eza stub first on the PATH.
  • viewer_eza makes sure that batpipe uses eza for directories when eza is installed.

Results of ./test.sh --suite batpipe:

Environment Before the change After the change
eza installed 5 of 8 pass (viewer_tar_gz and viewer_eza fail) 7 of 8 pass
No eza in PATH 4 of 8 pass (viewer_tar_bz2, viewer_tar_gz and viewer_eza fail) 7 of 8 pass

batpipe_term_width fails in all four runs. It also fails on master without this change, so it is not related to this change.

🤖 Generated with Claude Code

zsltg and others added 2 commits September 30, 2026 22:10
The viewer list depended on an inverted `command -v eza` check, and
the two lists were different. With eza installed, batpipe did not
open .tgz archives and used exa or ls for directories. Without eza,
it did not open .tbz archives and did not use exa.

This change keeps the intent of the two earlier changes:

- eth-p#105 wanted exa as a fallback when eza is not installed. Each
  viewer already checks its own command, so the order "eza" "exa"
  gives this fallback. ls stays the last directory viewer.
- eth-p#103 added the tar_gz and tar_bz2 viewers to one list. The merge
  with eth-p#105 (ba984f4) put them in different lists.

Fixes eth-p#153

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test that batpipe opens files inside .tgz and .tbz archives with and
without eza on the PATH, and that it uses eza for directories when
eza is installed. The tests put an eza stub on the PATH.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zsltg

zsltg commented Sep 30, 2026

Copy link
Copy Markdown
Author

The CI failures are not caused by this change:

  • Build: GitHub stops the job at setup because the workflow uses the deprecated actions/upload-artifact@v3.
  • Test: only batpipe_term_width fails. The same test fails on master without this change.

The Build and Test jobs failed in the same way on master in run 27102970337. The three new tests (viewer_tar_gz, viewer_tar_bz2, viewer_eza) pass on CI.

🤖 Generated with Claude Code

@zsltg

zsltg commented Sep 30, 2026

Copy link
Copy Markdown
Author

#156 fixes the two CI failures of this pull request (#147, #155). All CI jobs of #156 pass. After #156 is merged, I will rebase this pull request so that its CI passes too.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

batpipe: viewer list depends on eza, so .tgz, .tbz and the eza viewer do not work together

1 participant