ruby / reline

The compatible library with the API of Ruby's stdlib 'readline'

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Long lines containing multibyte characters sometimes disappear

elfham opened this issue · comments

commented

Description

Long lines containing multibyte characters sometimes disappear.

Steps to Reproduce

Environment:

irb(main):001> irb_info;
Ruby version: 3.1.4
IRB version: irb 1.7.4 (2023-07-15)
InputMethod: RelineInputMethod with Reline 0.3.7
RUBY_PLATFORM: amd64-freebsd13
LANG env: ja_JP.UTF-8
East Asian Ambiguous Width: 2
irb(main):002>

Scenario:

Set screen width to 80.

irb(main):002> Reline::IOGate.get_screen_size
=> [66, 80]
irb(main):003>

Type or paste "あああああああああああああああああああああああああああああああああ.
Type C-a, then the cursor located at the beginning of the line.

irb(main):002> Reline::IOGate.get_screen_size
=> [66, 80]
irb(main):003" "ああああああああああああああああああああああああああああああああ
あ

At this point, the input line is displayed correctly.

Type (a SPC).

irb(main):002> Reline::IOGate.get_screen_size
=> [66, 80]

ああ

The input line disappeared.

Type (a SPC).

irb(main):002> Reline::IOGate.get_screen_size
=> [66, 80]
irb(main):003"   "あああああああああああああああああああああああああああああああ
ああ

The input line appeared again.

Type (a SPC).

irb(main):002> Reline::IOGate.get_screen_size
=> [66, 80]

ああ

The input line disappeared again.

The display toggles in the same way.

Terminal Emulator

PuTTYrv 0.78-ranvis2 (CJK)

Fixed by #614