Cmder: Autocomplete for files doesn't work

Created on 4 Feb 2016  路  25Comments  路  Source: cmderdev/cmder

Autocompletion by pressing tab doesn't work in the latest Cmder I downloaded from the official website. This happens with the default settings (including a complete Reset...) and I couldn't find any setting that could fix this. Autocomplete works fine on directories and commands though.

馃憜 clink

Most helpful comment

I'm using Cmder latest with ConEmu 161206 x64 stable, and I can confirm that okitu's fix doesn't work. With no text on the prompt, the tab autocomplete does now correctly list the folder contents of the current working directory, but when anything is typed in matching only occurs with executables found in the PATH, not the current working directory, and not with anything other than executables.

To clarify what I did, re: #508, I modified the existing line setting exec_match_style = 2 to exec_match_style = -1

All 25 comments

I have the same problem. E.g. when I do a git add filename I get no autocompletion for filename. Is there a workaround until this gets fixed?

cmder 1.2.9
ConEmu 150913 [32]
Clink v0.4.7

It doesn't, same behavior exhibited.

Same here with git. Video: http://sendvid.com/efqrkp9g
I tried to install newest clink and conemu but this doesn't resolve this bug so problem is with cmder

A workaround could be git add -- file.

I don't see this problem, git add file complets here.

I did some experimentation earlier. The issue is "solved" if you remove clink entirely from vendor/clink/, but this causes various issues with text output:

cmder1

Replacing clink with other versions either does nothing or causes equivalent issues. However, replacing the clink component from my current, much older version of Cmder with the clink version supplied with the most recent Cmder doesn't affect the behavior and file completion still works normally in the old Cmder.

I'm also using Windows 7, if that makes a difference.

I just had the same problem with 1.2.9 and clink 0.4.7, as okoetter described it, I could not auto-complete filenames and directories after something like 'git add'. This seemed to only affect git, other commands worked fine.

Then I tested with 1.3.0-pre and with that version auto-completion works correctly.

I downloaded 1.3.0-pre with ConEmu 160328 and it also works for me now.

Still doesn't work for me on 1.3.0-pre. Completion currently only works for directories, .exe files and for some reason .js files. Possibly some others too but those are the only ones I noticed to work.

Also weird behavior with javascript files, if I write or complete the filename of an entire .js file and press TAB, it lists the entire contents of the current directory.

I had the problem (no tab completion for files after [git add ]). Upgrading to 1.3.0 fixed it for me, I think I had 1.3.0-pre before then.

Latest 1.3.2 still has this issue: no autocompletion for files within the current directory.

This here solved it for me:
https://github.com/cmderdev/cmder/issues/508#issuecomment-275409806

Yes, the setting mentioned okitu seems to finally resolve this for good!

I'm using Cmder latest with ConEmu 161206 x64 stable, and I can confirm that okitu's fix doesn't work. With no text on the prompt, the tab autocomplete does now correctly list the folder contents of the current working directory, but when anything is typed in matching only occurs with executables found in the PATH, not the current working directory, and not with anything other than executables.

To clarify what I did, re: #508, I modified the existing line setting exec_match_style = 2 to exec_match_style = -1

508 didn't do the trick for me, same as @drspangle

I have a scripts folder in PATH with some powershell scripts. I execute them a lot from everywhere in my system. It would be much easier with tab completion.

I deleted the file <%CMDER-ROOT%>\config\settings and restarted cmder.

Now I have auto-completion.

For me also https://github.com/cmderdev/cmder/issues/508 is not solution.

I tried exec_match_style = -1 but it introduces another problem - autocomplete doesn't display executable from PATH:

1) exec_match_style = 2
executable from PATH - OK
scripts from directory - FAIL

2) exec_match_style = -1
executable from PATH - FAIL
scripts from directory - OK

How to make it work for both cases?

Seems to work in the current version. Closing.

Still doesn't work as expected.
cmder version 1.3.10.811
OS: Windows 7 x64

How to reproduce:
precondition:
let we have test folder with one file inside: build.py
and test.exe in some folder which is specified in PATH

case 1. exec_match_style = 2

  • type 'bu' then - result: bunzip2.exe - Not OK
  • type 'te' then - result: test.exe - OK

case 2. exec_match_style = -1

  • type 'bu' then - result: build.py - OK
  • type 'te' then - result: - Not OK

What you are expecting is wrong. Tab completion works as it would on a Linux system, the current folder is not in the path and must be specified using .\ or ./. Try:

.\bu[tab]

.\ or ./ doesn't work

It does for me. What version you running?

cmder_tab_complete

I specified version above.
Can you try steps as I described?

I did and you are correct build.py does not auto complete but this is not a Cmder issue. You are trying to auto complete the first word of a line therefore a command to be run so the file must be executable in cmd.exe.

On Windows in cmd.exe sessions executeable file extensions are configured by the PATHEXT environment variable. Mine is currently set to:

PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

If I add .py to it autocomplete works.

Cool! Now it works as expected.
Thank you @daxgames !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jordanrobinson picture jordanrobinson  路  3Comments

emesx picture emesx  路  3Comments

jenisys picture jenisys  路  3Comments

isnullxbh picture isnullxbh  路  3Comments

danwellman picture danwellman  路  3Comments