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

Load history when starting a direct debug session #1046

Merged
merged 3 commits into from
Dec 12, 2024

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!

test/irb/test_history.rb Outdated Show resolved Hide resolved
@st0012 st0012 added the bug Something isn't working label Dec 12, 2024
lib/irb/debug.rb Outdated Show resolved Hide resolved
@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
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