Change tab-autocomplete to behave like cmd.exe and fixes #1144 as well