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 go-delve#3615
  • Loading branch information
aarzilli committed Jan 2, 2024
1 parent 31a3c0d commit 6fc1cfd
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 6fc1cfd

Please sign in to comment.