Skip to content

Commit

Permalink
terminal: add paging to print, vars, args and locals (#3620)
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 authored Jan 9, 2024
1 parent 1a1e215 commit f8de498
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 f8de498

Please sign in to comment.