summaryrefslogtreecommitdiff
path: root/lib/irb/context.rb
diff options
context:
space:
mode:
authorStan Lo <[email protected]>2023-08-13 19:30:30 +0100
committergit <[email protected]>2023-08-13 18:30:34 +0000
commit7f8f62c93bf3d11a0321fa91823065a2ff36f6d0 (patch)
tree2dffe13305f50883f33644f9d701ebb832ec0ab4 /lib/irb/context.rb
parent9099d62ac77cdca548bc4110e2cb03057ef0ac8f (diff)
[ruby/irb] Support seamless integration with ruby/debug
(https://github.com/ruby/irb/pull/575) * Support native integration with ruby/debug * Prevent using multi-irb and activating debugger at the same time Multi-irb makes a few assumptions: - IRB will manage all threads that host sub-irb sessions - All IRB sessions will be run on the threads created by IRB itself However, when using the debugger these assumptions are broken: - `debug` will freeze ALL threads when it suspends the session (e.g. when hitting a breakpoint, or performing step-debugging). - Since the irb-debug integration runs IRB as the debugger's interface, it will be run on the debugger's thread, which is not managed by IRB. So we should prevent the 2 features from being used at the same time. To do that, we check if the other feature is already activated when executing the commands that would activate the other feature. https://github.com/ruby/irb/commit/d8fb3246be
Diffstat (limited to 'lib/irb/context.rb')
-rw-r--r--lib/irb/context.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/irb/context.rb b/lib/irb/context.rb
index 18125ff6fb..43d9b53435 100644
--- a/lib/irb/context.rb
+++ b/lib/irb/context.rb
@@ -345,6 +345,8 @@ module IRB
# User-defined IRB command aliases
attr_accessor :command_aliases
+ attr_accessor :with_debugger
+
# Alias for #use_multiline
alias use_multiline? use_multiline
# Alias for #use_singleline