mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 04:27:29 +00:00
fix: dont get size of cygwin terminals
This commit is contained in:
@@ -31,9 +31,11 @@ const (
|
|||||||
|
|
||||||
// Given headers and rows, this function will print out a table
|
// Given headers and rows, this function will print out a table
|
||||||
func Table(headers [3]string, rows [][3]string) {
|
func Table(headers [3]string, rows [][3]string) {
|
||||||
// if we're not in a terminal, don't truncate the secret value
|
// if we're not in a terminal or cygwin terminal, don't truncate the secret value
|
||||||
shouldTruncate := isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd())
|
shouldTruncate := isatty.IsTerminal(os.Stdout.Fd())
|
||||||
|
|
||||||
|
// This will return an error if we're not in a terminal or
|
||||||
|
// if the terminal is a cygwin terminal like Git Bash.
|
||||||
width, _, err := term.GetSize(int(os.Stdout.Fd()))
|
width, _, err := term.GetSize(int(os.Stdout.Fd()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if shouldTruncate {
|
if shouldTruncate {
|
||||||
|
|||||||
Reference in New Issue
Block a user