Skip to content

test: Add regression test for less file-path detection#150

Open
nd-net wants to merge 1 commit into
eth-p:masterfrom
nd-net:test/batpipe-less-path-detection
Open

test: Add regression test for less file-path detection#150
nd-net wants to merge 1 commit into
eth-p:masterfrom
nd-net:test/batpipe-less-path-detection

Conversation

@nd-net

@nd-net nd-net commented Jun 16, 2026

Copy link
Copy Markdown

Adds a regression test for the batpipe parent-detection bug reported in #149: syntax color is lost when less opens a file with slashes in the path, because batpipe takes the basename of less's whole ps command line and sees the filename instead of less.

To exercise this, the less test shim is extended to honor a piped LESSOPEN and to re-exec with argv[0]=less (mirroring the existing fish/nu shims), since the suite mocks less.

Draft — depends on #96. This PR contains only the test, so the suite is red until the fix in #96 lands. I verified the test passes on top of #96's change.

Regression test for #149. Fix: #96.

less called as `less /path/file` shows up in `ps` with the path
appended; basename-ing the whole command line returns the file name
instead of `less`, so batpipe fails to detect less and disables color.
The `less` shim is extended to honor a piped LESSOPEN and report itself
as `less` (like the fish/nu shims) so the test can exercise this.
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.

1 participant