I have this problem and can’t figure out what causes it. Once in awhile (more recently the past month or so, unless I’m imagining it) my bash autocomplete adds a trailing slash when it doesn’t belong there.
Just like in this 10-year old StackExchange article. Which doesn’t seem to solve the problem.
Q: if I have to learn about bash completion anyway, should I learn how to do my own bash completion scripts? Because I’ve found that tab to expand is about as smart as I want it to be. (I’m always frustrated on my Linux system because the default there is to notice what the command is and only offer to expand certain compatible filetypes.) Here are two places to get started:
Q: I’ve moved (back) to MacPorts in the past year. Is that the problem? I don’t think so, since I’m still using the /bin/bash that comes with Mac OSX. (See here to fix that.)