szermatt / emacs-bash-completion

Add programmable bash completion to Emacs shell-mode
GNU General Public License v2.0
279 stars 33 forks source link

Space inserted after directory completion #23

Closed svend closed 6 years ago

svend commented 6 years ago

I'm getting a space inserted after tab-completing a directory name, when I'm expecting a slash.

This is on the development version of Emacs 26 on macOS 10.12.6.

GNU Emacs 26.0.50 (build 1, x86_64-apple-darwin16.7.0, NS appkit-1504.83 Version 10.12.6 (Build 16G29))

To reproduce, start emacs:

emacs -q

Evaluate the following:

 (require 'bash-completion)
  (setq bash-completion-args '("--noediting" "--login"))
  ;; I use nixpkgs bash, which puts bash in my PATH
  (setq bash-completion-prog "bash")
  (add-hook 'shell-dynamic-complete-functions
            'bash-completion-dynamic-complete)

Start a shell:

M-x shell

Type the following followed by :

cd /etc

This results in:

cd /etc<space>

Here is a screenshot:

image