3 ms·
Bash tab completion works for me in shell. GNU Emacs 23.2.1, x86_64-apple-darwin, on OS X 10.6.4. Term works fine as well.
by KC8ZKF 16y ago
Bash tab completion works for me in shell. GNU Emacs 23.2.1, x86_64-apple-darwin, on OS X 10.6.4.
Term works fine as well.
- jedbrown 16y agoM-x shell, then type git <TAB> Is it completing subcommands, or is it trying to complete file names (I always observe the latter)? Now type alias foo='cd /' foo ls <TAB> See how it tries to complete paths in ~ (or wherever your last path was instead of in the new directory). GNU Emacs 24.0.50.1 (Linux), and every version of Emacs I've used in the last 10 years.
- KC8ZKF 16y agogit <TAB> completes filenames, but so does bash in terminal. I don't have any fancy bash completion dingleberries installed. (And yes, my beard is grey too.) The alias completion does appear broken, as you demonstrated.
- d0mine 16y agogit <TAB> completes subcommands ls <TAB> with the alias shows files from the root / GNU Emacs 23.1.1 (Linux)
- jedbrown 16y agoAre you using shell-mode or something else (e.g. term-mode)? Completion works fine in term-mode (in term-char-mode) because it actually uses bash's completion mechanism. In contrast, shell-mode only does line-based interaction with the shell, and it generates its own completions. It recognizes commands like cd, pushd, and popd to maintain its own mirror of the current path. As far as I know, there is no shell-mode implementation that actually calls the shell for completions.
- d0mine 16y agomulti-term (term-char-mode/term-line-mode)
- basman 16y agoWhat you're seeing is not bash tab completion based on compgen, but shell-mode's implementation of tab completion. Which is why git <TAB>, for example, does not do what you'd like. It seems like it should be possible to write an emacs tab completer that actually calls bash's compgen, but I'm not aware of an implementation of this.