Skip to content

Commit 4e19f6b

Browse files
authored
Merge pull request #464 from ruby/workaround-for-alacritty-macos
Workaround for alacritty macos
2 parents aeead48 + fb4136c commit 4e19f6b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/reline/general_io.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ def self.cursor_pos
5757
Reline::CursorPos.new(1, 1)
5858
end
5959

60+
def self.hide_cursor
61+
end
62+
63+
def self.show_cursor
64+
end
65+
6066
def self.move_cursor_column(val)
6167
end
6268

lib/reline/line_editor.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,10 @@ def add_dialog_proc(name, p, context = nil)
655655
end
656656

657657
private def padding_space_with_escape_sequences(str, width)
658-
str + (' ' * (width - calculate_width(str, true)))
658+
padding_width = width - calculate_width(str, true)
659+
# padding_width should be only positive value. But macOS and Aracritty returns negative value.
660+
padding_width = 0 if padding_width < 0
661+
str + (' ' * padding_width)
659662
end
660663

661664
private def render_each_dialog(dialog, cursor_column)

0 commit comments

Comments
 (0)