Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!dciem!nrcaer!cognos!jimp From: jimp@cognos.uucp (Jim Patterson) Newsgroups: comp.os.vms Subject: Re: How to get multi-level command history to work? Message-ID: <1012@aldebaran.UUCP> Date: Mon, 29-Jun-87 12:18:04 EDT Article-I.D.: aldebara.1012 Posted: Mon Jun 29 12:18:04 1987 Date-Received: Wed, 1-Jul-87 04:25:18 EDT References: <1150@copper.TEK.COM> Reply-To: jimp@aldebaran.UUCP (Jim Patterson) Distribution: world Organization: Cognos Incorporated, Ottawa, Canada Lines: 34 In article <1150@copper.TEK.COM> stevesu@copper.UUCP (Steve Summit) writes: >Here's a new question, which I'm surprised hasn't been discussed >here already. The version 4 terminal driver provides for recall >of the previous command line, and DCL somehow extends this to the >last 20 lines. > >The obvious question is, how can I make my own interactive >applications interact with the terminal driver to provide deeper >command history? I am sure that there are undocumented terminal >driver qio's which implement this, someone out there knows, and I'm >sure many people would be interested to hear how. It's all documented in the I/O user's guide. If you want to do this at the QIO level, then you need to first disable automatic recall using the option TRM$M_TM_NORECALL, and trap the recall sequence yourself. A new terminal driver option called TRM$_INISTRNG allows you to place your own initialization string into the buffer prior to a terminal read; by keeping your own command history you can remember which string to put into the buffer at which time. However, SMG (DEC's SCREEN MANAGEMENT GRAPHICS) has already done all of this, and DEBUG and CMS just use SMG. By using the routine SMG$READ_COMPOSED_LINE instead of whatever read routine you have been using, you will automatically get 20-line recall. You have to use the associated routines for defining a virtual keyboard, etc, but it's all described in the RTL manual. As an added bonus you can set up your own version of DEFINE/KEY to map the keyboard for your program. -- Jim Patterson decvax!utzoo!dciem!nrcaer!cognos!jimp Cognos Incorporated