4 ms·
M-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='c
by jedbrown 16y ago
M-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)