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)