Commit graph

4 commits

Author SHA1 Message Date
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
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
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