Skip to content

Commit 2585b6d

Browse files
committed
use moby/term instead of x/term, same as docker/cli
1 parent 78cd09c commit 2585b6d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmd/docker-mcp/catalog/show.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"time"
1111

1212
"github.com/mikefarah/yq/v4/pkg/yqlib"
13-
"golang.org/x/term"
13+
"github.com/moby/term"
1414
"gopkg.in/yaml.v3"
1515

1616
"github.com/docker/mcp-gateway/pkg/yq"
@@ -171,11 +171,12 @@ func isURL(fileOrURL string) bool {
171171
}
172172

173173
func getTerminalWidth() int {
174-
width, _, err := term.GetSize(int(os.Stdout.Fd()))
174+
fd, _ := term.GetFdInfo(os.Stdout)
175+
ws, err := term.GetWinsize(fd)
175176
if err != nil {
176177
return 80
177178
}
178-
return width
179+
return int(ws.Width)
179180
}
180181

181182
func wrapText(text string, width int, indent string) string {

0 commit comments

Comments
 (0)