Skip to content

Revert "readline: clean up event listener in onNewListener"

This reverts PR #13266 and adds a regression test for #13557 (closed). After thinking about it for a bit, my patch proposed in the issue is not the right approach; #13266 was actually incorrect and should be undone.

The interface instance passed to emitKeypressEvents() is explicitly not for decoder lifetime control; it is just used to toggle tab completion on it. We provide emitKeypressEvents() as a standalone method as well, which should work on its own exactly as documented (i.e. independently of any readline interfaces by default).

My initial suggestion of removing the keypress decoder from the stream completely might leave partial reads in the string decoder unread, which we also want to avoid.

/cc @iarna @gibfahn

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

readline

Merge request reports

Loading