Search code examples
bashshellautocompletepermissionsmsys2

Msys2 autocomplete doesn't work for current directory


I installed msys2-x86_64-20161025.exe following these steps.

When I try autocompletion for programs on the PATH, e.g. by typing g and then pressing TAB key twice, Msys2 console shows me a lot of options (.exe , .dll , and others).

However, when I type ./ and then press TAB key twice, it shows me only subdirectories of the current directory, but not .sh or .bat files in the current directory.

ls -al command shows that Msys2 doesn't see "executable" file permission on the .bat and .sh files. chmod +x * doesn't seem to work on Windows.

So how to get autocomplete to work in Msys2 for current directory script files?

I am on Windows 10 x64. Let me know if some additional info about the environment is needed.


Solution

  • If your script contains a shebang line, msys2 will recognize the file as a script. That's has been my experience at least.

    Particularly for Bash scripts the first line of each script can be #!/bin/bash, if Bash is installed in /bin/. See more on Shebang line here.