From c815c0be46b83c1c5c50a88cd1452635208fbee4 Mon Sep 17 00:00:00 2001 From: aycabta Date: Fri, 24 Dec 2021 20:07:55 +0900 Subject: [ruby/reline] Escape newline(s) in dynamic prompt https://github.com/ruby/reline/commit/9b209ee1ea --- lib/reline/line_editor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/reline') diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index 5968af708b..90cc4b2db2 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -121,7 +121,7 @@ class Reline::LineEditor if use_cached_prompt_list prompt_list = @cached_prompt_list else - prompt_list = @cached_prompt_list = @prompt_proc.(buffer) + prompt_list = @cached_prompt_list = @prompt_proc.(buffer).map { |pr| pr.gsub("\n", "\\n") } @prompt_cache_time = Time.now.to_f end prompt_list.map!{ prompt } if @vi_arg or @searching_prompt -- cgit v1.2.3