Closed phikal closed 4 months ago
I have similar issue when I connect through TRAMP. I have a customized prompt.
My prompt is just a dollar sign, and this occurs locally. That being said, I do notice that the issue appears to disappear when I rename my .bashrc
to something else, which Bash won't load.
After experimenting a bit, I pulled out this block from by .bashrc
:
if [ -f /etc/bashrc ]
then
. /etc/bashrc
fi
and added that to my .bash_profile
. This had the same effect as disabling .bashrc
, but now my regular terminal didn't do any completion. This could be fixed by enabling the "Run command as login shell" option, in GNOME terminal.
Sorry for the long silence! I hadn't noticed this issue.
This issue could be caused by a lot of things, such as some version incompatibility or some option turned on in your .bashrc, which interferes with the communication between bash and Emacs.
Ill try and reproduce the problem with the exact same versions of Emacs and bash to figure out whether this is a version problem and update this issue with the result.
If I understood correctly your last message, you basically turned off completion everywhere. This is unfortunate. There are other things you could try instead, until the underlying issue is fixed:
Turn off sections of your bashrc when running on emacs by checking INSIDE_EMACS
. This way the non-emacs use-cases are not affected. For example:
if [[ -z "$INSIDE_EMACS" ]]; then
. /etc/bashrc # enable completion
fi
Execute M-x cutomize-option bash-completion-use-separate-process
and set the option to t
. With this option, emacs-bash-completion.el uses a separate bash process to do completion. It is less convenient, but more robust as a fallback.
Emacs version 30.0.50 is a development version, which means that a lot of things can go wrong and I'll have trouble testing with the exact same version you're using.
Did you try running with a stable version of Emacs, such as 29.4? Do you have the same issues?
Ill try and reproduce the problem with the exact same versions of Emacs and bash to figure out whether this is a version problem and update this issue with the result.
I tried with the head version of Emacs and bash 5.2.26. This combination seems to work.
From the error output, it seems that Emacs thinks that bash has been initialized, when it hasn't. This typically happens when running remote shell from ssh or shells within a docker instance - or even afterwards, trying to run local completion. The latest version of emacs-bash-completion contains change that are meant to address such issues. Please try the latest version of emacs-bash-completion from melpa instead of melpa-stable, or directly from github.
Hi, I was trying to complete a directory path
~/Doc
to~/Documents
usingM-x shell
, but instead I got this error message:I have had a similar issue from time to time, but haven't been able to identify what the root cause is. Does the above give any hints? My Bash version is