From 84417e233ef3d00a2e1f1483730679b665414e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Pavl=C3=AD=C4=8Dek?= Date: Mon, 18 Nov 2024 12:19:36 +0100 Subject: [PATCH] fix: truncated information on non-terminal table views --- src/cmdBuilder/executeRootCmd.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/cmdBuilder/executeRootCmd.go b/src/cmdBuilder/executeRootCmd.go index 0e313d08..452b9228 100644 --- a/src/cmdBuilder/executeRootCmd.go +++ b/src/cmdBuilder/executeRootCmd.go @@ -8,7 +8,6 @@ import ( "syscall" "github.com/pkg/errors" - "github.com/zeropsio/zcli/src/terminal" "golang.org/x/term" "gopkg.in/yaml.v3" @@ -19,6 +18,7 @@ import ( "github.com/zeropsio/zcli/src/logger" "github.com/zeropsio/zcli/src/storage" "github.com/zeropsio/zcli/src/support" + "github.com/zeropsio/zcli/src/terminal" "github.com/zeropsio/zcli/src/uxBlock" "github.com/zeropsio/zcli/src/uxBlock/styles" "github.com/zeropsio/zerops-go/apiError" @@ -30,15 +30,10 @@ func ExecuteRootCmd(rootCmd *Cmd) { ctx = support.Context(ctx) isTerminal := terminal.IsTerminal() - - width, _, err := term.GetSize(0) - if err != nil { - width = 100 - } - + terminalWidth, _, _ := term.GetSize(0) outputLogger, debugFileLogger := createLoggers(isTerminal) - uxBlocks := uxBlock.NewBlock(outputLogger, debugFileLogger, isTerminal, width, cancel) + uxBlocks := uxBlock.NewBlock(outputLogger, debugFileLogger, isTerminal, terminalWidth, cancel) cliStorage, err := createCliStorage() if err != nil {