This removes sensitivity to the BROWSER environment variable in tests
and makes it easier to verify the URL that the browser was invoked with
without having to stub sub-processes.
* Implement first round of support for GitHub Actions
This commit adds:
gh actions
gh run list
gh run view
gh job view
as part of our first round of actions support. These commands are
unlisted and considered in beta.
* review feedback
* tests for exit status on job view
* spinner tracks io itself
* review feedback
* fix PR matching
* enable pager for job log viewing
* add more colorf functions
* add AnnotationSymbol
* hide job, run
* do not add method to api.Client
* remove useless cargo coded copypasta
Sometimes, due to rounding errors, after calculating the width of each
column in a table, the sum of all columns would be shorter that the
total available width in the terminal. This reimplements the elastic
column resizing algorithm to ensure that all available space has been
filled.
As a bonus fix, columns that contain URLs are never truncated.
We used to send the ANSI sequence for "bright black" when we wanted gray, but this color turns out to not be visible in some popular color schemes.
Instead, when we detect a 256-color terminal, switch to displaying a color sequence for gray that is consistent and does not depend on terminal color scheme.
This commit is part of work to make gh more scriptable. It includes both
some general purpose helpers towards this goal as well as improvements
to the issue commands. Other commands will follow.
- Adds `utils/terminal.go` for finding out about gh's execution environment
- introduces `stubTerminal` for either faking being attached to a tty or not during tests
- updates issue commands to behave better when not attached to a tty:
- issue list doesn't print fuzzy dates
- issue list doesn't print header
- issue list prints state explicitly
- issue create no longer hangs
- issue create fails with clear error unless both -t and -b are specified
- issue view prints raw issue body
- issue view prints metadata in a consistent, linewise format
Explicitly assign the writer stream for the progress spinner so that
tests may override it.
The default when not in testing stays the same: the output stream is the
colorable stdout.
This indirectly also updates the chroma syntax highlighting package,
which fixes a rendering bug for CRLF line endings, which we
encountered in cli. We can therefore remove our internal work-around.