In the original cmd.exe in Windows, can be used to cycle through the auto completes candidates. But in cmder, this feature seems to be removed. Is there anyway to enable it?
4 Answers
As mentioned above, 'cmder' is an amalgamation of other open source software. The software which controls the tab completion behaviour is 'clink'. To change this behaviour, navigate to your 'cmder' directory and then find:
\cmder\vendor\clink\clink_inputrc_base
Open 'clink_inputrc_base', save a backup original, and then replace both lines that read:
"\t": clink-completion-shim
with:
"\t": menu-complete
for shift+tab cycle backward behaviour, also add a line below each of the above lines that reads:
"\e`Z": menu-complete-backward
This worked for me. Credit to this link for the info on modifying clink behaviour:
https://github.com/mridgers/clink/issues/190
EDIT: Please see my comment below, or additional answer from 'tides'. In newer versions of cmder the process is slightly simpler. You just have to uncomment the lines as described in the file, see my comment or other answer for more detail.
Actually, in the \cmder\vendor\clink\clink_inputrc_base file there are already these lines at the end:
# Uncomment these two lines for vanilla cmd.exe style completion.
# "\t": clink-menu-completion-shim
# "\e`Z": clink-backward-menu-completion-shim
If you remove the # characters of the last two lines you will get the desired behavior.
- 131
Clink changes Tab completion behavior. So: remove clink from vendors folder, uncheck Use clink in prompt.
- 20,835
The previous answers did not work for me. Here is how I got it to work, looking at Clink documentation and something from this post. First, instead of editing any base configuration file (which will probably be overwritten on updates anyway), create your own configuration file, which you can call .inputrc or _inputrc, in one of the following locations:
%CLINK_INPUTRC%%USERPROFILE%%LOCALAPPDATA%%APPDATA%%HOME%
Probably the most practical thing in most cases is to create it in your home directory (e.g. C:\Users\My Name\).
Inside that file, write the following content:
TAB: menu-complete
"\e[Z": menu-complete-backward
And that's it. It's still not exactly what I wanted, as I'd prefer it would show me the list of possible completions the first time I hit TAB and then scroll through them if I keep hitting it, but anyway.
Also, as pointed out in the Clink documentation, the settings in this .inputrc file may be used by other software that also uses readline. If you want these to only affect how Clink (and in turn ConEmu / Cmder) behave you can do something like this:
$if clink # begin clink-only section
TAB: menu-complete
"\e[Z": menu-complete-backward
$endif # end clink-only section
- 151