mirror of
https://github.com/mudler/luet.git
synced 2025-06-30 01:02:00 +00:00
- Ditch multiple libraries for progressbar, spinner, colors and replace with pterm - Detect when running on terminal and disable automatically spinner - Add support for multiple progress bars - Huge rewrite of the configuration part. No more crazy stuff with viper CLI commands now correctly overrides default config file as expected - Limit banner to be displayed on relevant parts Fixes #211 Fixes #105 Fixes #247 Fixes #233
12 lines
226 B
Go
12 lines
226 B
Go
package terminal
|
|
|
|
import (
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
// IsTerminal returns true if the given file descriptor is a terminal.
|
|
func isTerminal(fd int) bool {
|
|
_, err := unix.IoctlGetTermio(fd, unix.TCGETA)
|
|
return err == nil
|
|
}
|