From a89420dbbecce00afe48a48b728c77d74c7e1111 Mon Sep 17 00:00:00 2001 From: William Lawrence <39997789+william-lawrence@users.noreply.github.com> Date: Mon, 18 Aug 2025 10:28:01 -0400 Subject: [PATCH 1/3] Add test for whereami command alias --- test/console/whereami_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) 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 From a19c8c0dc4c322844804ef29c8bb298fc77714cb Mon Sep 17 00:00:00 2001 From: William Lawrence <39997789+william-lawrence@users.noreply.github.com> Date: Mon, 18 Aug 2025 10:32:02 -0400 Subject: [PATCH 2/3] Register alias for whereami command --- lib/debug/session.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/debug/session.rb b/lib/debug/session.rb index 3a101d6ee..ad7a98f12 100644 --- a/lib/debug/session.rb +++ b/lib/debug/session.rb @@ -739,7 +739,7 @@ def register_default_command # * `whereami` # * Show the current frame with source code. - register_command 'whereami', unsafe: false do + register_command 'whereami', '@', unsafe: false do request_tc [:show, :whereami] end From 9acb310d6f78be23f36c6e95485ebdfb7a707949 Mon Sep 17 00:00:00 2001 From: William Lawrence <39997789+william-lawrence@users.noreply.github.com> Date: Mon, 18 Aug 2025 10:37:05 -0400 Subject: [PATCH 3/3] Update documentation --- README.md | 2 ++ lib/debug/session.rb | 2 ++ 2 files changed, 4 insertions(+) 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 ad7a98f12..6d661f99b 100644 --- a/lib/debug/session.rb +++ b/lib/debug/session.rb @@ -739,6 +739,8 @@ def register_default_command # * `whereami` # * Show the current frame with source code. + # * `@` + # * Same as `whereami`. register_command 'whereami', '@', unsafe: false do request_tc [:show, :whereami] end