mfridman/tparse

PASS artifacts show when running with -h

Closed this issue · 2 comments

Sometimes when I run sparse I see PASS artifacts in the output in my terminal.

For example, when I run tparse -h I see:
Screen Shot 2022-05-25 at 9 23 47 PM

If I copy and paste the text from my terminal, the PASS artifacts are missing from the copied text:

❯ tparse -h
Usage:
        go test ./... -json | tparse [options...]
        go test [packages...] -json | tparse [options...]
        go test [packages...] -json > pkgs.out ; tparse [options...] -file pkgs.out

Options:
        -h              Show help.
        -v              Show version.
        -all            Display table event for pass and skip. (Failed items always displayed)
        -pass           Display table for passed tests.
        -skip           Display table for skipped tests.
        -notests        Display packages containing no test files or empty test files.
        -smallscreen    Split subtest names vertically to fit on smaller screens.
        -slow           Number of slowest tests to display. Default is 0, display all.
        -nocolor        Disable all colors. (NO_COLOR also supported)
        -format         The output format for tables [basic, plain, markdown]. Default is basic.
        -file           Read test output from a file.
        -follow         Follow raw output as go test is running.

Initially I thought this was a bug in my terminal, and it could still be, but in the same terminal window I can run a variety of other commands and the "PASS" artifacts do not show. When I run the tparse -h command, I see the PASS artifacts.

Interesting, I noticed this after adding the https://github.com/charmbracelet/lipgloss project (used for colors and table wrappers).

Although tparse -h shouldn't even hit any of those parts of the code and exit early in main.go.

So I wonder if there are side-effects from importing any of these packages:

	github.com/charmbracelet/lipgloss v0.4.0
	github.com/muesli/reflow v0.3.0 // indirect
	github.com/muesli/termenv v0.11.0

Needs a bit of investigation.

This should be resolved with changes I made earlier to the lipgloss package, if the issue persists drop a comment or open another issue.