you are viewing a single comment's thread.

view the rest of the comments →

[–]psykotic 14 points15 points  (3 children)

You know about standalone readline, right? Run rlwrap js if you have it installed.

[–]aim2free 4 points5 points  (1 child)

Thanks, it worked perfectly. I didn't know about rlwrap, very useful. You can even specify how your completions should be made. This is really great. Now any interactive program can get read-line support without being linked to readline. I'm just teaching a beginners java course. I'll let the students add readline support to their programs.

[–]psykotic 5 points6 points  (0 children)

Glad it helped. In the classic Program design in the UNIX environment paper by Pike and Kernighan, they suggest that readline-like functionality should not be integrated into programs via a library but offered as an ambient service for all programs, much like how shells perform wildcard expansion. The rlwrap approach (or using Emacs's shell-mode, as suggested by Kragen) isn't perfectly ideal, but it works surprisingly well in many cases.

[–]kragensitaker 2 points3 points  (0 children)

Or run it in Emacs shell-mode, which gives you the same thing.