From c33571518c39898541234b4372e212bf723e9bb5 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Wed, 4 Jun 2025 16:42:59 +0900 Subject: [PATCH] `no_repeat` option Entering an empty newline repeats the last command, such as `continue` or `list`. This configuration disable this feature. https://github.com/ruby/debug/issues/1098 --- lib/debug/config.rb | 1 + lib/debug/session.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/debug/config.rb b/lib/debug/config.rb index b083a5ca3..222e2a9d2 100644 --- a/lib/debug/config.rb +++ b/lib/debug/config.rb @@ -23,6 +23,7 @@ module DEBUGGER__ no_reline: ['RUBY_DEBUG_NO_RELINE', "UI: Do not use Reline library", :bool, "false"], no_hint: ['RUBY_DEBUG_NO_HINT', "UI: Do not show the hint on the REPL", :bool, "false"], no_lineno: ['RUBY_DEBUG_NO_LINENO', "UI: Do not show line numbers", :bool, "false"], + no_repeat: ['RUBY_DEBUG_NO_REPEAT', "UI: Do not repeat last line when empty line",:bool, "false"], irb_console: ["RUBY_DEBUG_IRB_CONSOLE", "UI: Use IRB as the console", :bool, "false"], # control setting diff --git a/lib/debug/session.rb b/lib/debug/session.rb index 05dc7f508..c1558df68 100644 --- a/lib/debug/session.rb +++ b/lib/debug/session.rb @@ -1144,7 +1144,7 @@ def register_default_command def process_command line if line.empty? - if @repl_prev_line + if @repl_prev_line && !CONFIG[:no_repeat] line = @repl_prev_line else return :retry