Clear screen missing function fix

This commit is contained in:
FlUxIuS 2024-07-14 17:14:55 +02:00
parent 2729300281
commit 5c09a0f186
No known key found for this signature in database
GPG Key ID: E8B96449EE4FA72F
2 changed files with 9 additions and 2 deletions

View File

@ -25,6 +25,7 @@ import (
"github.com/moby/term"
"golang.org/x/crypto/ssh/terminal"
"github.com/olekukonko/tablewriter"
rfutils "penthertz/rfswift/rfutils"
)
var inout chan []byte
@ -90,7 +91,7 @@ func DockerLast(ifilter string, labelKey string, labelValue string) {
panic(err)
}
clearScreen()
rfutils.ClearScreen()
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Created", "Image", "Container ID", "Command"})
@ -518,7 +519,7 @@ func PrintImagesTable(labelKey string, labelValue string) {
log.Fatalf("Error listing images: %v", err)
}
clearScreen()
rfutils.ClearScreen()
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"Repository", "Tag", "Image ID", "Created", "Size"})

View File

@ -101,3 +101,9 @@ func GetDisplayEnv() (string) {
}
return dispenv
}
func ClearScreen() {
cmd := exec.Command("clear")
cmd.Stdout = os.Stdout
cmd.Run()
}