Tab completion

#1
Hello Vince,

when - in the help (What's new) - you write "Tab completion now supports internal variables", what exactly do you mean?

The following - still - doesn't work:

vi %TC%\tcs<tab>

I still have to press <ctrl>x first (which is really annoying).

Btw. most (nearly all) tcmd.ini options governing the control of command line completion are missing from the help (e.g. CompleteHidden, CompletePaths, ServerCompletion - using the CHM's search option).

nickles
 
#2
nickles wrote:
| Hello Vince,

I think you meant Rex!

| when - in the help (What's new) - you write "Tab completion now
| supports internal variables", what exactly do you mean?
|
| The following - still - doesn't work:
|
| vi %TC%\tcs<tab>
|
| I still have to press <ctrl>x first (which is really annoying).

TC is an environment variable. The first character of the name of an
internal variable is always _ (underscore). Try to expand %_cmd using the
TAB key multiple times, it will propose %_cmdline, %_cmdproc and %_cmdspec.

| Btw. most (nearly all) tcmd.ini options governing the control of
| command line completion are missing from the help (e.g.
| CompleteHidden, CompletePaths, ServerCompletion - using the CHM's
| search option).

Rex wants us to use the OPTION dialog to set these. BTW, there is now a
separate OPTION dialog switch to complete hidden files and hidden
directories.
--
HTH, Steve
 

rconn

Administrator
Staff member
May 14, 2008
10,533
94
#3
> when - in the help (What's new) - you write "Tab completion now
> supports internal variables", what exactly do you mean?
>
> The following - still - doesn't work:
>
> vi %TC%\tcs<tab>
>
> I still have to press <ctrl>x first (which is really annoying).
That's variable expansion, not tab completion. (It's also not an internal
variable.)

V11 supports completing a variable name; i.e., something like "%_bat<tab>"
will expand to the internal variables beginning with "bat".


> Btw. most (nearly all) tcmd.ini options governing the control of
> command line completion are missing from the help (e.g. CompleteHidden,
> CompletePaths, ServerCompletion - using the CHM's search option).
All TCMD.INI options are missing from the help, with the exception of key
mapping or advanced directives.

All others are in the OPTION dialogs, which is the only way we support their
use.

Rex Conn
JP Software
 
#4
@Vince

Sorry for addressing you (I think I got used to communicating with you over the last few days ;-).

Of course I meant to address JPSoft (Rex).

@Steve

Thanks for the answers despite of not having been addressed!

@Rex

1) I obviously got the terms wrong (tab completion <=> variable expansion); sorry for that.
However, the problem I describe already appeared in the suggestions for a new version (i.e. 11) some time ago. Do you see a chance to implement such a behavior? It would *really* be appreciated (and come pretty handy).

2) Sorry to hear that. I use a structured tcmd.ini file which is completely "devastated" after using OPTION.

Thanks to all

nickles
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,586
46
Albuquerque, NM
prospero.unm.edu
#5
1) I obviously got the terms wrong (tab completion <=> variable expansion); sorry for that.
However, the problem I describe already appeared in the suggestions for a new version (i.e. 11) some time ago. Do you see a chance to implement such a behavior? It would *really* be appreciated (and come pretty handy).
You can expand variables on the command line with Control-X. (You can assign a different key with the VariableExpand .INI directive, if you like.)
 
#6
@Charles

I'm aware of that. However it would be nice to have the following working w/o having to press <ctrl>x first:

%systemroot%\win<tab>[TAB]

instead of

%systemroot%\win<ctrl>[CTRL-x<tab>][TAB]

nickles
</tab></ctrl></tab></ctrl>
 
#7
nickles wrote:
| @Charles
|
| I'm aware of that. However it would be nice to have the following
| working w/o having to press <ctrl>x first:
|
| %systemroot%\win<tab>
|
| instead of
|
| %systemroot%\win<ctrl>x<tab>

That would be esp. useful when it is part of a FOR command, because using
the "VariableExpand" key also "expands" ALL variables in the command line.

V12 suggestion: let the VariableExpand key operate ONLY on the variable
whose name is "under" the cursor, instead of all variables in the whole
command line.
--
Steve
 
May 29, 2008
529
3
Groton, CT
#8
<ctrl><tab><ctrl><tab>
V12 suggestion: let the VariableExpand key operate ONLY on the variable
whose name is "under" the cursor, instead of all variables in the whole
command line.
I disagree with that. I find it very useful to expand all the variables at once.
Rex, if you're thinking about changing this, please consider a configurable ini-option like "Ctrl/X expands all variables or just one" [all|ONE].


</tab></ctrl></tab></ctrl>
 
#9
dcantor wrote:
| ---Quote (Originally by Steve Fbin)---
| <ctrl><tab><ctrl><tab>
| V12 suggestion: let the VariableExpand key operate ONLY on the
| variable
| whose name is "under" the cursor, instead of all variables in the
| whole
| command line.
| ---End Quote---
| I disagree with that. I find it very useful to expand all the
| variables at once.
| Rex, if you're thinking about changing this, please consider a
| configurable ini-option like "Ctrl/X expands all variables or just
| one" [all|ONE].

Try a command like this:

for %x in (%appdata%\mydata\alpha\*) echo %@filesize[%x] %x

and decide that you need APPDATa expanded so you could use TAB completion
for one more level down, after you type the whole command, and this is what
you'll see:

for 1 in (c:\documents ...\mydata\alpha\*) echo 0 1

so you need to go back and retype the command.

The OP's suggestion that tab-completion act as variable expansion would have
worked. For the more general case I think we might just want another key
defined for command editing, which expands only the variable under the
cursor. If that happens to be a "compound variable", expansion would go as
far as the specific object, but no further. For example, if you have the
construct %@left[5,%@name[%[z%x]]] in the command line, and the cursor is on
the Z, only z%x would be expanded, but not @name. With the cursor somewhere
in the @name that function would also be evaluated.
--
Steve
 
May 29, 2008
529
3
Groton, CT
#10
dcantor wrote:
| ---Quote (Originally by Steve Fbin)---
| <ctrl><tab><ctrl><tab>
| V12 suggestion: let the VariableExpand key operate ONLY on the
| variable
| whose name is "under" the cursor, instead of all variables in the
| whole
| command line.
| ---End Quote---
| I disagree with that. I find it very useful to expand all the
| variables at once.
| Rex, if you're thinking about changing this, please consider a
| configurable ini-option like "Ctrl/X expands all variables or just
| one" [all|ONE].

Try a command like this:

for %x in (%appdata%\mydata\alpha\*) echo %@filesize[%x] %x

and decide that you need APPDATa expanded so you could use TAB completion
for one more level down, after you type the whole command, and this is what
you'll see:

for 1 in (c:\documents ...\mydata\alpha\*) echo 0 1

so you need to go back and retype the command.

The OP's suggestion that tab-completion act as variable expansion would have worked. {snip}
Yes, I agree that there are times when expanding just one variable would be a good thing. I would still prefer that the current behavior be retained or that it be a configurable option.

Having another keystroke would be okay, but I fear we will run out of keystrokes eventually.


</tab></ctrl></tab></ctrl>