Repository navigation
Fix the cause of test_yamatanooroti randomly failing - #474
Conversation
I think cooked mode is making backspace ignored (not sent to remote server), and this pull request might improve it. |
|
@tompng |
|
@hasumikin # jumping cursors
Reline::LineEditor.prepend Module.new{
def render_dialog(...); sleep 0.2; super(...); end
}# remaining strings
class Reline::LineEditor::Dialog
def contents;sleep 0.005;@contents;end
end |
f8b184f to
a797eaa
Compare
|
I checked on macOS, and Linux is also Reline::ANSI, so I think it's ok. |
|
It works fine on Windows. |
(ruby/reline#474) * Add repeated input-delete test that fails on HEAD * Use raw mode while readmultiline
(ruby/reline#474) * Add repeated input-delete test that fails on HEAD * Use raw mode while readmultiline
When pressing tab key for a long time, cursor is moving right and left. On the right end, something(

ntand----) is remain displayed.This behavior is also causing random test failure in
rake test_yamatanooroti.These tests failed in my local environment (macOS, Terminal.app, vterm 0.2, looks like fails more frequently compared to ci)
I ran
test_update_cursor_correctly_when_just_cursor_moving, the most frequently failing test in local for 100 times(local) and 50 times(ci in forked repository: tompng@da6b2c5, job result: https://github.com/tompng/reline/actions/runs/3307143383/jobs/5458548780)Failing result sometimes contains
^Band^N.This is because getc in ansi.rb is using
STDIN.raw{getc}, that means there is a non-raw time between the next getc.When there is new input while rendering a dialog, prompt or something else, the input is echo-ed.
To fix this, reline should not echo while editing multiline.
Changes
I added
Reline::IOGate.with_raw_inputand used inReline.readmultiline.I used
IO#raw, notIO#noecho. noecho will show a key mark cursor for password input in Terminal.app and iTerm2 and maybe other teminals.In raw mode,
\nwill only move cursor down, not left-end of the next line andtest_terminate_in_the_middle_of_lineswill fail. So I added\rto methodrerenderinline_editor.rbAdded test writing
a[delete]a[delete]a[delete]...(4000 times)to vterm.In HEAD, it fails with
failed result: https://github.com/tompng/reline/actions/runs/3307571761/jobs/5459304761