`doom/reload` doesn't work with Nushell

What happened?

Since switching to Nushell I get the following output when calling doom/reload

"/home/<user>/.emacs.d/bin/doom" sync -e
Error: nu::parser::parse_mismatch

  × Parse mismatch during operation.
 1 │ "/home/jkappes/.emacs.d/bin/doom" sync -e
   ·                                   ──┬─
   ·                                     ╰── expected operator

Comint exited abnormally with code 1 at Fri Nov  3 12:34:54

Can I work around this? Can this be “fixed” within Doom?

What did you expect to happen?

Doom reloads.

Steps to reproduce

  1. Install Nushell
  2. chsh to it
  3. doom/reload

System information

Loading data dump...
1 Like

Hi, I ran into this same issue. The root of the problem is that Nushell doesn’t allow commands to be quoted. Here’s a quick solution I came up with:

(defun doom-reload-fix-bin (orig-fun)
  (if (stringp doom-bin)
      (setq doom-bin (intern doom-bin)))
  (funcall orig-fun))
(advice-add 'doom/reload :around #'doom-reload-fix-bin)

If you want more details, I wrote up a blog post explaining the issue

1 Like

Using nushell as a login shell (with chsh) doesn’t seem like a good idea. I switched to Nushell for daily use a few months ago and so far like it a lot. Unfortunately I had multiple issues with programs that use login shell to run commands (like Doom Emacs does).

The solution I came up with it to use bash as my login shell, and configure tmux to launch nushell. Since I always use tmux, I have nushell for interactive use, but Doom uses bash when it shells out. If you are not using tmux, you can do something similar with terminal emulators. Here is how I told Doom to use login shell.

This topic was automatically closed after 90 days. New replies are no longer allowed.