jart / bestline

ANSI Standard X3.64 Teletypewriter Command Session Library
Other
443 stars 29 forks source link

Make bestline work in rc #33

Open MaxGyver83 opened 2 months ago

MaxGyver83 commented 2 months ago

I have created a pull request to rakitzis/rc to integrate bestline: Support bestline for line editing #100.

Unfortunately, bestline isn't ideal to be used in rc as it is now:

To be useful in a shell, it's necessary to pass the cursor position when calling the complete function because the user might want to complete any word (token) in the current command line. I'm aware that this is a breaking change. But it might make bestline more suitable for other projects, too.

This pull request also adds a new libbestline.so target to the Makefile because the rc maintainers prefer linking against a shared library instead of copying the current state of a line editing library (at least they did in the past: https://github.com/rakitzis/rc/pull/5#issuecomment-304394764).