We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e036798 commit 623dffdCopy full SHA for 623dffd
lib/reline.rb
@@ -336,8 +336,14 @@ def readline(prompt = '', add_hist = false)
336
@ambiguous_width = 2 if Reline::IOGate == Reline::GeneralIO or STDOUT.is_a?(File)
337
return if ambiguous_width
338
Reline::IOGate.move_cursor_column(0)
339
- output.write "\u{25bd}"
340
- @ambiguous_width = Reline::IOGate.cursor_pos.x
+ begin
+ output.write "\u{25bd}"
341
+ rescue Encoding::UndefinedConversionError
342
+ # LANG=C
343
+ @ambiguous_width = 1
344
+ else
345
+ @ambiguous_width = Reline::IOGate.cursor_pos.x
346
+ end
347
348
Reline::IOGate.erase_after_cursor
349
end
0 commit comments