mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/reline] Suppress error when check ambiguous char width in LANG=C
https://github.com/ruby/reline/commit/623dffdd75
This commit is contained in:
parent
8911b3d3e8
commit
69cd27c98e
1 changed files with 8 additions and 2 deletions
|
@ -336,8 +336,14 @@ module Reline
|
|||
@ambiguous_width = 2 if Reline::IOGate == Reline::GeneralIO or STDOUT.is_a?(File)
|
||||
return if ambiguous_width
|
||||
Reline::IOGate.move_cursor_column(0)
|
||||
output.write "\u{25bd}"
|
||||
@ambiguous_width = Reline::IOGate.cursor_pos.x
|
||||
begin
|
||||
output.write "\u{25bd}"
|
||||
rescue Encoding::UndefinedConversionError
|
||||
# LANG=C
|
||||
@ambiguous_width = 1
|
||||
else
|
||||
@ambiguous_width = Reline::IOGate.cursor_pos.x
|
||||
end
|
||||
Reline::IOGate.move_cursor_column(0)
|
||||
Reline::IOGate.erase_after_cursor
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue