Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!ucsd!ucbvax!hplabs!hpfcso!hpfcmgw!eugene From: eugene@hpfcmgw.HP.COM (Gene Dick) Newsgroups: comp.sys.hp Subject: Re: CI.STK history function Message-ID: <1080129@hpfcmgw.HP.COM> Date: 23 Feb 90 22:42:28 GMT References: <1990Feb19.235123.5458@sjuphil.uucp> Organization: HP Fort Collins, CO Lines: 52 >> >> - CI: only works on HP terminals, and if EnqAck handshake >> enabled >> - ksh: works on any terminal described by terminfo > This is true. The command stack reads what is written on the > screen NOT what was in its input buffer. Thus a terminal that > can send the entire line is required. Again I agree that this is true, except the requirement of having EnqAck. In my HP-UX environment I can be using any HP terminal, or Hpterm window in X11 (I have not tried an xterm window) to use a psuedo CI command mode edit (in csh). This method will not work directly on a bit-mapped display outside a window environment. The only features implemented are the / and // without any search capability. I have since switched to ksh and the vi mode of editing commands, but the / and // CI method normally requires less keystrokes to accomplish the same editing. So, here are the two csh aliases I have used. I have seen other methods which also work. The line length is rather long so I have broken them up into 5 lines. Lines 1 & 2 as well as 3-5 should be concatenated. 1) alias / 'history | sed -e "s/.......//" -e "\~^//* *"\$"~d" | 2) tail -\!*; line > /dev/null; /bin/echo "\033J\033R\033A\033d\021\c"' 3) alias // 'history | sed -e "s/.......//" -e "\~^//* *"\$"~d" | 4) tail -1; /bin/echo "\033A\c"; line > /dev/null; 5) /bin/echo "\033J\033R\033A\033d\021\c"' The key to this working is exactly what the CI process does, at the end of the last echo command are the characters \033d and \021. The escape sequence of \033d puts the "terminal" into a transmit line mode and the \021 starts the transfer. The other escape sequences put the cursor at the start of the line being edited. ***CAUTION NOTE****>> When used on an hpterm window: if during editing you place the cursor on a blank line, the hpterm window will *HANG*. So at least move the cursor to some "safe" command or type one in *BEFORE* hitting the return key. #include Standard-disclaimer Gene Dick eugene@hpfcmr