When using Emacs shell with the auto-completion feature enabled, I notice that whenever I perform typing and auto-completing a command, Emacs shell always adds an extra space after the first word. I illustrate this issue by an example as follow:
Suppose that my current working directory is
user@linux ~/foo/bar $
Now if I want to type the command
mkdirby auto-completion, I first type
mk, and then press
TABto show a list of completion possibilities and press
mkdir. Now, a whitespace is added at the end of
mkdir, which is indicated by the pair
user@linux ~/foo/bar $ mkdir[ ]
In this scenario, adding a whitespace after the command
mkdiris fine since
mkdiris a full command, I certainly want to type a new word after that.
But if the first word is not a full command, but a part of a command, a white-space is still added and it is quite inconvenient.
For example, I want to type and auto-complete the command such as
Then, if I type
~/workfirst and then press
TABto auto-complete, Emacs shell will automatically add a new white-space after the first directory
~/workspace, which is indicated by
user@linux ~/foo/bar $ ~/workspace[ ]
This is an unwanted white-space, since I have to delete it, in order to continue typing the rest of
Is there anybody know how to make Emacs shell knows when an extra white-space should be added?
FYI, I am using the Spacemacs distribution of Emacs.
I discovered that this is due to the package bash-completion of Emacs. After removing it, the Emacs shell works as usual.