Skip to content

Commit

Permalink
terminal: add paging to print, vars, args and locals
Browse files Browse the repository at this point in the history
Add automatic paging to the output of print, vars, args and locals.

Fixes #3615
  • Loading branch information
aarzilli committed Jan 3, 2024
1 parent 3372f5c commit 5878337
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/terminal/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5878337

Please sign in to comment.