separate the command language and interactive shell

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Mon Apr 29 03:33:11 AEST 1991


I use various shells for my ``command language'' and a souped-up line
discipline for my ``interactive shell.'' I just added some of the new
interactive features to my poor man's line discipline. From pmlined's
latest README:

  You edit the current line on the status line (through stderr). Long
  lines scroll horizontally. When you press return, pmlined sends the
  line to stdout. All the usual editing characters, including ^U, ^W,
  backspace, delete, and ^V, work normally. ^A switches between this
  editing mode and the usual tty mode. In version 1.5, you also get ^H
  and ^L to move the cursor back and forth within the line, and a
  20-line editable history with ^B and ^F. In this version, ^P sets the
  prompt to whatever you've typed on the current line. Note that the
  prompt will be reset if you use a command from the history that had a
  different prompt. ^O<char> stores the current line in a macro labelled
  <char>; you invoke the program with <tab><char>. (Use ^V to enter
  special characters into the macro.) The arrow keys now work for up (^B),
  down (^F), left (^H), and right (^L).

At 400-odd lines pmlined is hardly a bloated piece of code. It doesn't
bother with multiplexing or tty handling or any system stuff; it just
reads its input, gives you an interactive display on stderr, and feeds
completed lines to your shell (typically ``pty csh'') through stdout.
It's hard to get much simpler than that!

---Dan



More information about the Comp.unix.shell mailing list