20

When I'm debugging with Byebug sometimes I evaluate some variables in the terminal which causes the displayed line context to 'go up'. Then I would like to print it again to screen. How can I do that?

I thought maybe 'display' will do that but apparently it does something else.

Eyal Levin
  • 16,271
  • 6
  • 66
  • 56

2 Answers2

36

I think you're looking for list = which basically shows you where you are in the same manner as when you first drop into the debugger (by default - you can turn autolist off).

There are a few different options for the list command. list = centres the display around the current line. Without the = it will show the next 10 lines.

Shadwell
  • 34,314
  • 14
  • 94
  • 99
2

You can do l = or l= or list =. They are all the same.

Ref Shadwell's answer & barlop's comment.

eho
  • 169
  • 1
  • 10
  • This should be clear from that answer and the comment, I don't see the value that you have added to a 6 year old post, OP isn't likely to come back and accept this. You could add your own comment or edit the post, but this isn't different enough from the existing answer to justify adding a new one. – Chris Schaller Sep 10 '20 at 02:47