[Info-vax] Filename completion, was: Re: VMS Features I Wish Linux Had

Simon Clubley clubley at remove_me.eisner.decus.org-Earth.UFP
Fri Jun 10 14:29:48 EDT 2016


On 2016-06-10, John E. Malmberg <wb8tyw at qsl.net_work> wrote:
>
> One issue with the VMS terminal line editing is because it is handled in 
> the driver, it does not have access to the filesystem to allow it to do 
> filename completion.
>

That's easy enough to fix with some enhancements. Assume you want to
emulate the bash tab completion model which is the most elegant way
I've come across so far. One suggestion (which would have to be turned
on by the caller (ie: the shell/CLI) as required):

Make the Tab an input termination character and pass back to the caller
the fact that Tab was pressed _and_ the position in the input line it
was pressed at. This position is basically a one-dimensional cursor.

The shell/CLI calls a lib$expand_filenames with the line and cursor
position within the line. It fills in whatever unique characters it
can, modifies the cursor position in the line as required and passes
back to the caller a list of matching filenames so the caller can
display them to the user.

The shell/CLI then issues a new read to VMS with the modified line and
cursor position within the line and the user then carries on typing.

For this to work properly, the VMS terminal driver needs the ability
to edit across lines, including the ability to move back up a line on
the screen so that when there's only one matching filename the visual
effect is that the full filename is inserted and any text to the right
of the line cursor is scrolled to the right, including across any line
boundaries as required.

Don't forget that you may type in a command line (or recall it) and
then go and change a filename within the middle of the command line.
The above scheme handles that and gives you terminal driver editing
_and_ filename completion.

Simon.

-- 
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world



More information about the Info-vax mailing list