Can't change workspace after entering `debug`
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start at lib/irb/debug/ui.rb around line 59, then reproduce the reported sequence of changing or pushing a workspace before and after entering debug mode. Verify that workspace commands and statements continue to use the selected workspace after debug is entered, including after changing workspace or pushing one to the stack.
Written by the indexing model from the issue text.
Description
Description
After entering debug mode, all workspace functionality stops working. It's no longer possible to perform commands or statements under a different workspace after changing the workspace or pushing a workspace to the stack.
This happens because under debug mode, the current workspace is replaced and lines are always read with the context of the debug binding or the top level binding.
https://github.com/ruby/irb/blob/66318d0a343552715f214f07c57bc4a60552ccfd/lib/irb/debug/ui.rb#L59
Since it's not possible to exit debug mode, the workspace functionality is lost within irb for the remaining of the process.
irb(main):001> chws
Current workspace: main
=> nil
irb(main):002> chws foo
Current workspace: #<Foo:0x000000010a8ef250>
=> nil
irb(#<Foo:0x000000010a8ef250>):003> bar
=> "I'm a private method"
irb(#<Foo:0x000000010a8ef250>):004> chws
Current workspace: main
=> nil
irb(main):005> debug
irb:rdbg(main):006> chws foo
Current workspace: #<Foo:0x000000010a8ef250>
=> nil
irb:rdbg(#<Foo:0x000000010a8ef250>):007> bar
eval error: undefined local variable or method `bar' for main
(rdbg)/test.rb:1:in `<main>'
nil
irb:rdbg(main):008>
Result of irb_info
irb:rdbg(main):009> irb_info
Ruby version: 3.3.0
IRB version: irb 1.13.0 (2024-05-01)
InputMethod: RelineInputMethod with Reline 0.5.5
Completion: Autocomplete, RegexpCompletor
RUBY_PLATFORM: x86_64-darwin23
LANG env: en_CA.UTF-8
East Asian Ambiguous Width: 1
Terminal Emulator
kitty terminal
Setting Files
No settings file
- Dominant language
- Ruby
- Stars
- 477
- Forks
- 165
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ruby/irb
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
Maintainers usually reply within 2 days
-
Proposal: public hook for external documentation providers in show_doc and the completion doc dialogPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 5/5 Over a week Newbie friendliness 38/100
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 2 days
Similar issues
-
bug f:request-creation professional
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
mysociety/alaveteli#9733 · 1 comment ·
Maintainers usually reply within 1 day
-
needs verification
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 13 days
-
🐛 bug 👩💻 équipe CE 🧑🏭 entreprises
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
betagouv/conseillers-entreprises#4808 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100