diff --git a/lib/byebug/interfaces/local_interface.rb b/lib/byebug/interfaces/local_interface.rb index 65b7d67c8..c9262f21e 100644 --- a/lib/byebug/interfaces/local_interface.rb +++ b/lib/byebug/interfaces/local_interface.rb @@ -21,7 +21,7 @@ def initialize # @param prompt Prompt to be displayed. # def readline(prompt) - with_repl_like_sigint { Readline.readline(prompt) || EOF_ALIAS } + with_repl_like_sigint { without_irb_completion { Readline.readline(prompt) || EOF_ALIAS } } end # @@ -40,5 +40,14 @@ def with_repl_like_sigint ensure trap("INT", orig_handler) end + + # Disables the Readline completion proc installed by IRB on ruby2.7 + def without_irb_completion + orig_completion = Readline.completion_proc + Readline.completion_proc = nil + yield + ensure + Readline.completion_proc = orig_completion + end end end