Can't change workspace after entering `debug`
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 lib/irb/debug/ui.rb 大约第 59 行开始,然后重现报告中的操作顺序:在进入调试模式之前和之后更改工作区,或将工作区推入堆栈。验证进入调试模式后,工作区命令和语句仍继续使用所选工作区,包括更改工作区或将工作区推入堆栈之后。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Ruby
- 星标
- 477
- 派生
- 165
- 平均合并
- 1 天 19 小时
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ruby/irb 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 45/100
维护者通常 2 天内回复
-
Proposal: public hook for external documentation providers in show_doc and the completion doc dialog可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 5/5 一周以上 新手友好度 38/100
维护者通常 2 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
维护者通常 2 天内回复
相似的 Issue
-
bug f:request-creation professional
难度 2/5 1-3 小时 新手友好度 64/100
mysociety/alaveteli#9733 · 1 条评论 ·
维护者通常 1 天内回复
-
needs verification
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 13 天内回复
-
🐛 bug 👩💻 équipe CE 🧑🏭 entreprises
难度 2/5 1-3 小时 新手友好度 76/100
betagouv/conseillers-entreprises#4808 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 78/100