The `issue comment` command would perform a `filepath.Base()` on the
value of EDITOR and use the result for launching the editor, which is
undesireable for both functional and display purposes:
- For functional purposes, always shellsplit the value of GH_EDITOR or
EDITOR before we shell out to that process;
- For display purposes, extract the basename only after shellsplitting.
`GH_FORCE_TTY` only affects stdout, not stderr, so this check was
failing and the flag was being ignored.
I also checked for similar problem in other files but everything else
seemed stderr or stdin related.
closes#5354
* after merge, switch to base branch if available
* Add ability to checkout new branch
* Style cleanup
Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
I always get tripped up whenever trying to list my codespaces, adding
`ls` as an alias to `list` feels natural enough.
Co-authored-by: Mislav Marohnić <mislav@github.com>
While a gh command is writing stdout to a pager, the user may choose to
close the pager program before the pager has read all the data on its
standard input. In that case, the parent gh process will receive an
EPIPE error, which would bubble up its error handling and cause it to
print something like:
write |1: broken pipe
Since this was caused by an explicit user action of closing the pager,
and since the user probably doesn't want to see this uninformative
error, this informs our global error handling of this error and causes
it to be ignored.
* pr-checks: extract webMode
* pr-checks: extract checks information collection
* pr-checks: extract output utilities
* pr-checks: implement watch flag
* pr-checks: remove SIGINT interceptor
* pr-checks: exit with error if some task has failed
* update flags help text
* update default interval to 10s
* move interval flag parse to RunE
* refactor checksRunWatchMode to use infinite loop
* Refactor printTable function
* Refactor collect function
* Set up checksRun to use new refactored functions and simplify logic a bit
* Add tests
* Always set interval in opts
* use Duration flag
* Revert back to using int flag for consistency with run watch
* Use run watch screen clearing mechanism
* Re-add pager support
Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
Add pager functionality to the following commands:
- gist list
- pr checks
- release list
- run list
- run view
- secret list
- workflow list
- workflow view
Additionally, normalize error handling when starting the pager has
failed: only print a non-fatal notice to stderr instead of aborting the
whole command.
If the base branch has no minimum approval requirements, show "N Approved"
reviews. Otherwise, show "N/X Approved".
Co-authored-by: Mislav Marohnić <mislav@github.com>