diff --git a/README.md b/README.md index 4d9dc631a..fe9dacfc7 100644 --- a/README.md +++ b/README.md @@ -675,6 +675,8 @@ The `<…>` notation means the argument. * Show current frame's source code from the line to if given. * `whereami` * Show the current frame with source code. +* `@` + * Same as `whereami`. * `edit` * Open the current file on the editor (use `EDITOR` environment variable). * Note that edited file will not be reloaded. diff --git a/lib/debug/session.rb b/lib/debug/session.rb index 3a101d6ee..6d661f99b 100644 --- a/lib/debug/session.rb +++ b/lib/debug/session.rb @@ -739,7 +739,9 @@ def register_default_command # * `whereami` # * Show the current frame with source code. - register_command 'whereami', unsafe: false do + # * `@` + # * Same as `whereami`. + register_command 'whereami', '@', unsafe: false do request_tc [:show, :whereami] end diff --git a/test/console/whereami_test.rb b/test/console/whereami_test.rb index 3d937fdea..ae3996b93 100644 --- a/test/console/whereami_test.rb +++ b/test/console/whereami_test.rb @@ -45,6 +45,12 @@ def test_whereami_displays_current_frames_code assert_no_line_text(/b = 1/) assert_line_text(/=> 1\| a = 1/) + type "@" + + # with @, we should see same output as whereami (above) + assert_no_line_text(/b = 1/) + assert_line_text(/=> 1\| a = 1/) + type "list" # list command should work as normal after whereami is executed