Skip to content

Conversation

@sunblaze
Copy link
Contributor

When starting a debug session directly with RUBY_DEBUG_IRB_CONSOLE=1 and require 'debug'; debugger, IRB's history wasn't loaded. This commit ensures history is loaded in this case by calling load_history when configuring IRB for the debugger.

Fixes #975

When starting a debug session directly with RUBY_DEBUG_IRB_CONSOLE=1 and
`require 'debug'; debugger`, IRB's history wasn't loaded. This commit ensures
history is loaded in this case by calling `load_history` when configuring IRB
for the debugger.

Fixes ruby#975
Copy link
Member

@st0012 st0012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm the patch fixes the issue, thank you!

@st0012 st0012 added the bug Something isn't working label Dec 12, 2024
@st0012 st0012 merged commit 7f851b5 into ruby:master Dec 12, 2024
30 checks passed
matzbot pushed a commit to ruby/ruby that referenced this pull request Dec 12, 2024
(ruby/irb#1046)

* Load history when starting a direct debug session

When starting a debug session directly with RUBY_DEBUG_IRB_CONSOLE=1 and
`require 'debug'; debugger`, IRB's history wasn't loaded. This commit ensures
history is loaded in this case by calling `load_history` when configuring IRB
for the debugger.

Fixes ruby/irb#975

* Update test/irb/test_history.rb

* Update lib/irb/debug.rb

---------

ruby/irb@7f851b5353

Co-authored-by: Stan Lo <stan001212@gmail.com>
@sunblaze sunblaze deleted the direct_debug_session_loads_history branch December 16, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HISTORY is unavailable when using rails console with RUBY_DEBUG_IRB_CONSOLE=1

2 participants