bmatsuo / jqsh

An interactive wrapper to the jq command line utility
MIT License
23 stars 2 forks source link

readline alternative #3

Open bmatsuo opened 10 years ago

bmatsuo commented 10 years ago

Since readline won't work an alternative needs to be found. A pure Go library would be ideal. But decent C bindings with a reasonable license would be fine too. This thread should collect requirements and decide on an alternative package.

Things like my vim ~/.inputrc bindings are probably a lot cause (nooooo!).

bmatsuo commented 10 years ago

If someone wanted to help all they need to do is rewrite, or provide a new implementation of, the ShellReader interface which parses commands into string slices. It's pretty straight forward.

Ping me @bmatsuo before you start working on this so I can agree beforehand to the library you want to use and your plan.

bmatsuo commented 10 years ago

For now rlwrap seems to do a sufficient job with the proper options.

rlwrap -A -N jqsh

The rlwrap man page suggests that -N is Linux only (edit: a warning is also displayed on startup), but it seemed to help for me on OS X 10.9 Mavericks. /shrug

bmatsuo commented 10 years ago

I don't think readline proper is the right way to go. The utility needs to be statically linked IMO. That would mean including the readline source and making the license GNU GPL.

An interesting alternative may be code.google.com/p/go.crytpo/ssh/terminal. It is pretty low level, so probably best to look at the importers first.

edit: looks like no one has taken that package and tried to implement anything close to a reasonably featured readline replacement.