minad / consult

:mag: consult.el - Consulting completing-read
GNU General Public License v3.0
1.13k stars 99 forks source link

"Wrong type argument: stringp, nil" as soon as I started vterm #895

Closed thomaslaich closed 6 months ago

thomaslaich commented 6 months ago

Hi!

I was banging my head against this for quite some time now, so I see no other option than to make an issue here.

consult generally works great for me. However, if I open a buffer with vterm, I can no longer invoke consult-find, consult-ripgrep, or consult-grep. That is, I get the following error (with stack trace shown here):

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  call-process(nil nil nil nil "-c" "find -regextype emacs -version")
  process-file(nil nil nil nil "-c" "find -regextype emacs -version")
  #f(compiled-function () #<bytecode -0x18f402be3ae14c24>)()
  with-connection-local-variables-1(#f(compiled-function () #<bytecode -0x18f402be3ae14c24>))
  process-file-shell-command("find -regextype emacs -version")
  consult--find-make-builder(("."))
  consult-find(nil)
  funcall-interactively(consult-find nil)
  command-execute(consult-find)

Oddly, consult-fd continues to work. The problem also persists after I kill the vterm buffer again.

Not sure this is the right place for this issue, as I'm not sure whether this is a problem of vterm, consult, or my config.

My config is here: https://github.com/thomaslaich/nix-config/blob/main/home/emacs/config.el

I'm an emacs newbie, so very possible that I configured something completely wrong.

minad commented 6 months ago

Hi, please follow the steps from https://github.com/minad/consult#bug-reports, such that we can narrow down the cause of the problem. Given that other commands like consult-fd work it is likely that this is not a bug in Consult. Thanks!

thomaslaich commented 6 months ago

Sorry for not following the bug report guidelines! Will not do that again.

I tried to follow all the steps in the guidelines and could indeed solve the issue, thanks!

Turns out that I messed up the shell-file-name variable in my config and accidentally set it to nil. On a completely minimal configuration (with just consult, vertico, and vterm and nothing else), I can set this variable to nil and break consult with it. But I guess this is not a bug :)