szermatt / emacs-bash-completion

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

Completion becomes unresponsive after entering `guix shell` #62

Closed Apteryks closed 1 year ago

Apteryks commented 1 year ago

Hi!

This package is very useful, but I have one problem with it. I'm a GNU Guix user and when I spawn a new shell with extra dependencies such as with:

$ guix shell make
[env]$ ./mount [TAB] [TAB]

Then hitting TAB takes some time then prints completion--some: Bash completion failed. M-x bash-completion-debug for details. M-x bash-completion-debug shows:

commandline: <<EOF
__emacs_complete_pre_command;  echo -n "pwd=${PWD}";compgen -b -c -a -A function -- ./mount 2>/dev/null
EOF

error: "timeout"
buffer-string: <<EOF
bash: __emacs_complete_pre_command: command not found
pwd=/home/maxim/proj/x./mountimg.sh
maxim@hurd ~/proj/x [env]$ EOF

process: #<process shell>
output-buffer: <<EOF
bash: __emacs_complete_pre_command: command not found
pwd=/home/maxim/proj/x./mountimg.sh
maxim@hurd ~/proj/x [env]$ EOF

emacs-version: "28.2"
context: #s(completion "./mount"
              ("./mount")
              0 "./mount" 3500 "./mount" nil nil "\"'><=;|&(:" ...)

complete-p: (("mv" "-F" "_longopt")
 ("gksudo" "-F" "_root_command")
 ("nice" "-F" "_command")
 ("tr" "-F" "_longopt")
 ("head" "-F" "_longopt")
 ("sha256sum" "-F" "_longopt")
 ("uniq" "-F" "_longopt")
 ("else" "-F" "_command")
 ("gksu" "-F" "_root_command")
 ("ptx" "-F" "_longopt")
 ...)

I was expecting it to be able to complete the executable script in the current directory, mountimg.sh.

Any ideas of what could be going wrong or how to improve the situation?

Thank you!

szermatt commented 1 year ago

Please try with the very latest version of emacs-bash-completion from github. There have been quite some changes that makes this kind of things work that aren't included in any released versions yet. Let me know if you try it out and still see issues.

Alternatively, if you want to keep on using an older version, you can make it work if you're really careful. What you should do, in this case, is either:

With the latest version emacs-bash-completion from github, there's nothing to do; it should just work.

szermatt commented 1 year ago

The relevant changes have now been included into melpa 20230208.1903. You can download it from there instead of getting it using git, if you prefer.

Apteryks commented 1 year ago

Hi! Sounds good! I'll update the emacs-bash-completion package to that version, and report back. Thanks!

Apteryks commented 1 year ago

It works great! :-) Thanks a lot for the improvements!