README 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. rlfe (ReadLine Front-End) is a "universal wrapper" around readline.
  2. You specify an interactive program to run (typically a shell), and
  3. readline is used to edit input lines.
  4. There are other such front-ends; what distinguishes this one is that
  5. it monitors the state of the inferior pty, and if the inferior program
  6. switches its terminal to raw mode, then rlfe passes your characters
  7. through directly. This basically means you can run your entire
  8. session (including bash and terminal-mode emacs) under rlfe.
  9. FEATURES
  10. * Can use all readline commands (and history) in commands that
  11. read input lines in "canonical mode" - even 'cat'!
  12. * Automatically switches between "readline-editing mode" and "raw mode"
  13. depending on the terminal mode. If the inferior program invokes
  14. readline itself, it will do its own line editing. (The inferior
  15. readline will not know about rlfe, and it will have its own history.)
  16. You can even run programs like 'emavs -nw' and 'vi' under rlfe.
  17. The goal is you could leave rlfe always on without even knowing
  18. about it. (We're not quite there, but it works tolerably well.)
  19. * The input line (after any prompt) is changed to bold-face.
  20. INSTALL
  21. The usual: ./configure && make && make install
  22. Note so far rlfe has only been tested on GNU Linux (Fedora Core 2)
  23. and Mac OS X (10.3).
  24. This assumes readline header files and libraries are in the default
  25. places. If not, you can create a link named readline pointing to the
  26. readline sources. To link with libreadline.a and libhistory.a
  27. you can copy or link them, or add LDFLAGS='-/path/to/readline' to
  28. the make command-line.
  29. USAGE
  30. Just run it. That by default runs bash. You can run some other
  31. command by giving it as command-line arguments.
  32. There are a few tweaks: -h allows you to name the history file,
  33. and -s allows you to specify its size. It default to "emacs" mode,
  34. but if the the environment variable EDITOR is set to "vi" that
  35. mode is chosen.
  36. ISSUES
  37. * The mode switching depends on the terminal mode set by the inferior
  38. program. Thus ssh/telnet/screen-type programs will typically be in
  39. raw mode, so rlfe won't be much use, even if remote programs run in
  40. canonical mode. The work-around is to run rlfe on the remote end.
  41. * Echo supression and prompt recognition are somewhat fragile.
  42. (A protocol so that the o/s tty code can reliably communicate its
  43. state to rlfe could solve this problem, and the previous one.)
  44. * See the intro to rlfe.c for more notes.
  45. * Assumes a VT100-compatible terminal, though that could be generalized
  46. if anybody cares.
  47. * Requires ncurses.
  48. * It would be useful to integrate rlfe's logic in a terminal emulator.
  49. That would make it easier to reposition the edit position with a mouse,
  50. integrate cut-and-paste with the system clipboard, and more robustly
  51. handle escape sequence and multi-byte characters more robustly.
  52. AUTHOR
  53. Per Bothner <per@bothner.com>
  54. LICENSE
  55. GPL.