mirror of
https://github.com/hanzoai/container.git
synced 2026-10-30 15:06:01 +00:00
* misc: minor typo in docs * net: introduce configurable network driver * net: fix default in template * ci: fix lint errors * net: fix regression * net: addn docker hostname for slirp network
20 lines
259 B
Go
20 lines
259 B
Go
package terminal
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"golang.org/x/term"
|
|
)
|
|
|
|
var isTerminal = term.IsTerminal(int(os.Stdout.Fd()))
|
|
|
|
// ClearLine clears the previous line of the terminal
|
|
func ClearLine() {
|
|
if !isTerminal {
|
|
return
|
|
}
|
|
|
|
fmt.Print("\033[1A \033[2K \r")
|
|
}
|