summaryrefslogtreecommitdiff
path: root/lib/reline
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-12-24 20:06:48 +0900
committergit <svn-admin@ruby-lang.org>2021-12-25 00:32:57 +0900
commitb0db420b0e70753986d42579439acdd7ff0d9e95 (patch)
treed55f5934cac635dc01ac3297986575ac8954de0b /lib/reline
parent22cc2243f92ef09c10534412511a02ca8ccd45cb (diff)
[ruby/reline] Escape newline(s) in prompt
https://github.com/ruby/reline/commit/b545459fca
Diffstat (limited to 'lib/reline')
-rw-r--r--lib/reline/line_editor.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb
index ff5d160e64..5968af708b 100644
--- a/lib/reline/line_editor.rb
+++ b/lib/reline/line_editor.rb
@@ -260,7 +260,7 @@ class Reline::LineEditor
end
def reset_variables(prompt = '', encoding:)
- @prompt = prompt
+ @prompt = prompt.gsub("\n", "\\n")
@mark_pointer = nil
@encoding = encoding
@is_multiline = false