aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reline.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/reline.rb')
-rw-r--r--lib/reline.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/reline.rb b/lib/reline.rb
index 3303fb4dd4..2708cd91b5 100644
--- a/lib/reline.rb
+++ b/lib/reline.rb
@@ -175,7 +175,7 @@ module Reline
whole_buffer = line_editor.whole_buffer.dup
whole_buffer.taint if RUBY_VERSION < '2.7'
- if add_hist and whole_buffer and whole_buffer.chomp.size > 0
+ if add_hist and whole_buffer and whole_buffer.chomp("\n").size > 0
Reline::HISTORY << whole_buffer
end
@@ -188,8 +188,8 @@ module Reline
line = line_editor.line.dup
line.taint if RUBY_VERSION < '2.7'
- if add_hist and line and line.chomp.size > 0
- Reline::HISTORY << line.chomp
+ if add_hist and line and line.chomp("\n").size > 0
+ Reline::HISTORY << line.chomp("\n")
end
line_editor.reset_line if line_editor.line.nil?