is there any opensource .com file for the purpose of auto-complete in command line?

StackOverflow https://stackoverflow.com/questions/10938946

  •  13-06-2021
  •  | 
  •  

Question

In Linux, we have tab to do autocomplete for either command autocomplete or filename autocomplete. I know there are some freeware for this purpose, but what I can search online are binary files, is there any open source .com file for this purpose? I mean, once run this .com file when logon, we can use the tab to do autocomplete afterwards.

Was it helpful?

Solution

DCL (the .com-file interpreter) by itself does not have facilities to handle custom key intercept. To implement TAB autocomplete one needs to intercept TAB press. That's why a separate [freeware] utility is used.

Alternatively, installing GNV-kit (GNU-not-VMS:ports many linux utils) will let one use bash instead of DCL, autocomplete will then work from bash.

If you need "autocomplete" just for globbing the filenames, then using wildcards may be a shortcut (perhaps dir it first). You may also lookup f$search and f$parse lexicals (>>help lex f$search), which essentially do globbing. E.g.>> type 'f$search("f*.txt") !!-- will type out the first file matched to f*.txt

If you need "autocomplete" to traverse directories, then it could be done with a DCL script that will make use of f$search internally. In fact I wrote such for myself sometime ago, I use it instead of "set default" to navigate directories (similar to CD command -- freeware also has something like this)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top