Skip to content

Load history when starting a direct debug session#1046

Merged
st0012 merged 3 commits into
ruby:masterfrom
sunblaze:direct_debug_session_loads_history
Dec 12, 2024
Merged

Load history when starting a direct debug session#1046
st0012 merged 3 commits into
ruby:masterfrom
sunblaze:direct_debug_session_loads_history

Conversation

@sunblaze

Copy link
Copy Markdown
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

@st0012 st0012 left a comment

Copy link
Copy Markdown
Member

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!

Comment thread test/irb/test_history.rb Outdated
@st0012 st0012 added the bug Something isn't working label Dec 12, 2024
Comment thread lib/irb/debug.rb Outdated
@st0012 st0012 merged commit 7f851b5 into ruby:master Dec 12, 2024
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