2023-02-02 17:15:17 -08:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
2020-07-14 14:32:47 -07:00
|
|
|
package base
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"os"
|
|
|
|
|
|
|
|
|
|
"github.com/mitchellh/cli"
|
2021-02-12 11:05:33 -05:00
|
|
|
"golang.org/x/term"
|
2020-07-14 14:32:47 -07:00
|
|
|
)
|
|
|
|
|
|
2020-08-10 17:15:02 -04:00
|
|
|
type BoundaryUI struct {
|
2020-07-14 14:32:47 -07:00
|
|
|
cli.Ui
|
|
|
|
|
Format string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var TermWidth uint = 80
|
|
|
|
|
|
|
|
|
|
func init() {
|
2021-02-12 11:05:33 -05:00
|
|
|
width, _, err := term.GetSize(int(os.Stdin.Fd()))
|
2020-07-14 14:32:47 -07:00
|
|
|
if err == nil {
|
|
|
|
|
TermWidth = uint(width)
|
|
|
|
|
}
|
|
|
|
|
}
|