From 6fc1cfdab084b3202f662ae994957d95b34557cc Mon Sep 17 00:00:00 2001 From: aarzilli Date: Tue, 2 Jan 2024 12:51:10 +0100 Subject: [PATCH] terminal: add paging to print, vars, args and locals Add automatic paging to the output of print, vars, args and locals. Fixes #3615 --- pkg/terminal/command.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/terminal/command.go b/pkg/terminal/command.go index a9c1f0239d..787a441be8 100644 --- a/pkg/terminal/command.go +++ b/pkg/terminal/command.go @@ -2138,6 +2138,8 @@ func (c *Commands) printVar(t *Term, ctx callContext, args string) error { return err } + t.stdout.pw.PageMaybe(nil) + fmt.Fprintln(t.stdout, val.MultilineString("", fmtstr)) if val.Kind == reflect.Chan { @@ -2208,6 +2210,7 @@ func (t *Term) printFilteredVariables(varType string, vars []api.Variable, filte return err } match := false + t.stdout.pw.PageMaybe(nil) for _, v := range vars { if reg == nil || reg.Match([]byte(v.Name)) { match = true