Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't change workspace after entering debug #952

Open
larissa opened this issue May 6, 2024 · 0 comments
Open

Can't change workspace after entering debug #952

larissa opened this issue May 6, 2024 · 0 comments

Comments

@larissa
Copy link

larissa commented May 6, 2024

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.

cmd = @irb.debug_readline(tc.current_frame.binding || TOPLEVEL_BINDING)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant