From f5fa30d59574c9e7882cde99a16ad008aca0dcc8 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 2 Sep 2022 14:25:51 +0900 Subject: [PATCH 1/2] Added some of abstruct methods for cursor --- lib/reline/general_io.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/reline/general_io.rb b/lib/reline/general_io.rb index 3fafad5c6e..92c76cbba1 100644 --- a/lib/reline/general_io.rb +++ b/lib/reline/general_io.rb @@ -57,6 +57,12 @@ def self.cursor_pos Reline::CursorPos.new(1, 1) end + def self.hide_cursor + end + + def self.show_cursor + end + def self.move_cursor_column(val) end From fb4136c8a7d536e05e064f48baa259364956370a Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 2 Sep 2022 14:26:17 +0900 Subject: [PATCH 2/2] Workaround for padding width with Aracritty on macOS --- lib/reline/line_editor.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index 8d0719ef7c..1e830eb888 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -655,7 +655,10 @@ def add_dialog_proc(name, p, context = nil) end private def padding_space_with_escape_sequences(str, width) - str + (' ' * (width - calculate_width(str, true))) + padding_width = width - calculate_width(str, true) + # padding_width should be only positive value. But macOS and Aracritty returns negative value. + padding_width = 0 if padding_width < 0 + str + (' ' * padding_width) end private def render_each_dialog(dialog, cursor_column)