8

Git for Windows installs "Git Bash," a bash shell that works in Windows, which is very nice. It's based on MinTTY, I believe.

As well as bash shell scripts, it can also execute Windows batch (.bat) files, e.g.

$ ./some-batch-file.bat

executes without any issue.

But tab-completion doesn't work on these batch files. Typing ./some-TAB has no effect.

Is there some way to enable tab-completion for .bat files in Git bash?

KRyan
  • 264

2 Answers2

3

I've manged to get this working, I found a post about getting .sh files to work in Git Bash using this on the first line of the file:

#!/bin/sh

This also works when placed on the first line of .bat files. You still have to start with the ./ before the file name.

The Coder
  • 151
1

I can at least provide a workaround for those interested. I start with typing vi or ls followed by ./ and from there tab completion works then I just move the cursor to the start of the line with Home and press Delete three times.

I wish I could just add .bat to an environment variable that holds a list for tab completion but I'm not sure there is one?

Kasper-34
  • 23
  • 5