Commit graph

107 commits

Author SHA1 Message Date
Jeff Hubbard
7678274464
Merge pull request #5076 from cli/multi-devcontainer
Multi devcontainer
2022-04-20 12:06:23 -07:00
Roshan Padaki
51301f8782
Fix table printer crashing in narrow terminals (#5449)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-04-13 14:57:41 +00:00
Jeff Hubbard
b8ecbe748f go fmt 2022-03-29 13:50:31 -07:00
Jeff Hubbard
ef0672eac0
Merge branch 'trunk' into multi-devcontainer 2022-03-29 13:46:05 -07:00
Nate Smith
e2fd7ceff0
Merge pull request #5369 from cli/gh-status 2022-03-29 11:32:28 -05:00
lylecantcode
56fda0f8c6
Support GH_DEBUG to control verbosity, deprecate DEBUG (#5306)
The GH_DEBUG environment variable is a new gh-specific verbosity control.

For backwards-compatibility, DEBUG will still be respected if it has values
"1", "true", "yes", and "api", but any other values will be ignored.

Finally, support for "oauth" debug value has been dropped in favor of "api".
The "oauth" value only had limited, internal use.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-03-29 18:05:35 +02:00
Jeff Hubbard
9554e522af Change the way we parse list-devcontainers response 2022-03-28 14:24:57 -07:00
nate smith
f22c325ea4 gh status 2022-03-28 11:53:13 -05:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Heath Stewart
e2973453b5
Add helper template functions for rendering tables (#3519)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-08-23 21:00:25 +02:00
Tobias Klauser
b586d51778 Use golang.org/x/term
The golang.org/x/crypto/ssh/terminal package is deprecated and merely a
wrapper around golang.org/x/term. Use the latter directly.
2021-04-28 18:44:36 +02:00
Cristian Dominguez
fb39c38c85 Disable preview option in prompts if URL size is too long 2021-03-30 19:12:31 +02:00
Mislav Marohnić
44ae7ae3cf
Merge pull request #3279 from cli/browser-refactor
Pass web browser to each individual command
2021-03-30 16:54:59 +02:00
Mislav Marohnić
b70b0402eb
Merge pull request #3200 from cli/table-widths
Ensure that table printer always uses all available width in the terminal
2021-03-30 16:54:13 +02:00
Mislav Marohnić
111e8dbcf2 Pass web browser to each individual command
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.
2021-03-19 21:22:37 +01:00
Nate Smith
126b498e9f
Actions Support Phase 1 (#2923)
* 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
2021-03-16 13:59:34 -07:00
Mislav Marohnić
ed15bebb84 Ensure that table printer fills the full width of the terminal
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.
2021-03-11 19:04:57 +01:00
Mislav Marohnić
a2bee1fad3 🔥 utils.Spinner 2021-01-20 14:48:14 +01:00
Sam Coe
c843a4fa13
Add issue comment viewing 2020-12-07 14:25:04 -05:00
vilmibm
a2aa154794 port entirely to ColorScheme 2020-10-29 12:37:45 -07:00
Dimitris Apostolou
6f550b5d12
Fix typos 2020-10-04 22:16:30 +03:00
Nate Smith
b987cfb39e
Merge pull request #1955 from thealamu/trunk
Avoid interface for collecting file descriptors
2020-09-29 11:37:33 -05:00
Faithfulness Alamu
0206648175 Avoid interface for collecting file descriptors
Avoid using interface{} as a catch-all in IsTerminal and
IsCygwinTerminal functions.
The use of *os.File allows for static type error checks.
2020-09-25 11:31:22 +01:00
Sam Coe
ed4075517c
Check for terminal background color before starting pager 2020-09-24 13:06:28 +02:00
zacanger
f17d9672f5
fix(browser): show message if $BROWSER isn't in $PATH (#1749) 2020-09-23 12:17:54 +02:00
Mislav Marohnić
88aacc14f0 Fix gray color presentation across terminals
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.
2020-09-16 17:57:13 +02:00
Mislav Marohnić
086d8ed29a Merge remote-tracking branch 'origin' into color-env 2020-09-16 16:51:38 +02:00
Mislav Marohnić
d38a0c5d84 Encapsulate checking color-controlling environment variables 2020-09-07 13:10:43 +02:00
Mislav Marohnić
ca2f2b18ca Add support for CLICOLOR "standard"
The CLICOLOR_FORCE environment variable can now be used to force color
output even when stdout is redirected. https://bixense.com/clicolors/
2020-09-04 21:32:58 +02:00
vilmibm
8dd93e1748 gh pr checks
A basic first pass on gh pr checks that shows all check runs for a given
PR's latest commit.
2020-08-28 13:18:59 -05:00
Mislav Marohnić
fcaf912961 Merge branch 'pr-commands-isolate-2' into pr-commands-isolate-3 2020-08-11 15:30:09 +02:00
vilmibm
35f18b6c02 gh auth login 2020-08-06 12:43:35 -05:00
Mislav Marohnić
82661c197e Isolate pr list command 2020-08-04 18:38:06 +02:00
Shubhankar Kanchan Gupta
bb6851c88b
Add "open" qualifier when listing open issues/PRs (#1457) 2020-07-31 18:22:08 +02:00
Jesse Millar
90f04d4864 Enable custom color themes with the GLAMOUR_STYLE environment variable 2020-07-28 15:23:48 +02:00
vilmibm
086fb48d31 move displayURL 2020-07-23 11:25:31 -05:00
vilmibm
70c948a751 move isURL 2020-07-23 11:23:45 -05:00
Mislav Marohnić
cbcc778d20 Adapt markdown rendering for light terminal backgrounds
Bonus: disallows trying to first read `notty` and `dark` style files from disk
2020-07-21 13:16:42 +02:00
vilmibm
b7765591b7 remove package level terminal check state 2020-07-17 15:02:05 -05:00
vilmibm
36ade42ba3 scriptability improvements: issue commands
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
2020-07-14 12:30:53 -05:00
Shubhankar Kanchan Gupta
1ddb4d76a7
Strip carriage returns in markdown rendering (#1351) 2020-07-10 16:01:15 +02:00
Mislav Marohnić
ac7d5ecc44 Ensure markdown still passed through Glamour in no-color mode 2020-06-22 19:44:16 +02:00
Mislav Marohnić
04b18ea8cb 🔥 unused var 2020-06-22 19:32:06 +02:00
Mislav Marohnić
55be0d2a9c Tweak isColorEnabled 2020-06-22 19:18:18 +02:00
gabgodBB
e6e8f701a2 Issue #930 - Removing color for output files 2020-06-12 14:26:38 -03:00
gedenata
4c94d126da variable global color 2020-06-10 14:02:42 +08:00
gedenata
81799caeb6 variable global color 2020-06-10 13:59:28 +08:00
gedenata
417de6257a variable global color 2020-06-10 13:57:31 +08:00
vilmibm
15a6225f05 totally inelegant approach to hopefully stopping flakey tests 2020-04-29 14:17:16 -05:00
Mislav Marohnić
aa183d7408 Set spinner writer stream in a preferred way 2020-04-13 14:09:56 +02:00