test: Add regression test for less file-path detection#150
Open
nd-net wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a regression test for the batpipe parent-detection bug reported in #149: syntax color is lost when
lessopens a file with slashes in the path, because batpipe takes the basename of less's wholepscommand line and sees the filename instead ofless.To exercise this, the
lesstest shim is extended to honor a pipedLESSOPENand to re-exec withargv[0]=less(mirroring the existingfish/nushims), since the suite mocksless.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.