Rails and Byebug - How can I re-display the current line context

byebug, ruby-on-rails

Solution

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.

Problem

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.

Original source