Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in process filter #37

Closed
leafarbelm opened this issue Sep 11, 2020 · 6 comments
Closed

Error in process filter #37

leafarbelm opened this issue Sep 11, 2020 · 6 comments

Comments

@leafarbelm
Copy link

Emacs version: 27.1
nodejs-repl version: 0.2.4
Node version: 14.10.1

Steps to reproduce:
1. Open any .js file
2. Execute M-x nodejs-repl
3. digit any expression on the repl (e.g. 5 + 8)

I installed this mode and when i execute any expression in the REPL buffer i get the following errors:

error in process filter: run-hook-with-args: End of buffer
error in process filter: End of buffer

and the RELP hang up a little bit, i don't now much about elisp so i was wondering if someone could help me with this?

This is the config i use, nothing especial:

(use-package nodejs-repl
  :config
  (add-hook 'js-mode-hook
          (lambda ()
            (define-key js-mode-map (kbd "C-x C-e") 'nodejs-repl-send-last-expression)
            (define-key js-mode-map (kbd "C-c C-j") 'nodejs-repl-send-line)
            (define-key js-mode-map (kbd "C-c C-r") 'nodejs-repl-send-region)
            (define-key js-mode-map (kbd "C-c C-c") 'nodejs-repl-send-buffer)
            (define-key js-mode-map (kbd "C-c C-l") 'nodejs-repl-load-file)
            (define-key js-mode-map (kbd "C-c C-z") 'nodejs-repl-switch-to-repl))))

@zodmaner
Copy link

I've also encountered this problem on Emacs 26.3 with nodejs-repl versions 0.2.4 and 0.2.3 and Node versions v14.12.0 and v12.18.4.

@digitables
Copy link

Hi, I've also had this problem with Node v16.9.1, nodejs-repl version 0.2.4, and emacs version 27.1

@digitables
Copy link

digitables commented Sep 20, 2021

Found a fix on floscr's emacs config! IIRC map! is a Doom Emacs thing so it might not work on vanilla or spacemacs.
https://github.com/floscr/emacs.d/blob/master/config.org
The specific thing I did was add the following snipped to the end of ~/.doom.d/config.el:

(map!
 :after comint
 :map comint-mode-map
 :ni "RET" (cmd! (comint-send-input nil t))
 :n "<C-backspace>" #'comint-clear-buffer)

@dop
Copy link

dop commented Oct 19, 2021

I think I have a workaround. It seems that culprit is nodejs-repl--delete-prompt in comint-output-filter-functions.

(defun dp/nodejs-repl-remove-broken-filter ()
  (remove-hook 'comint-output-filter-functions 'nodejs-repl--delete-prompt t))
(add-hook 'nodejs-repl-mode-hook #'dp/nodejs-repl-remove-broken-filter)

This results in duplicated prompt from time to time. But it's better than freezing.

@dfpetrin
Copy link

Found a fix on floscr's emacs config! IIRC map! is a Doom Emacs thing so it might not work on vanilla or spacemacs. https://github.com/floscr/emacs.d/blob/master/config.org The specific thing I did was add the following snipped to the end of ~/.doom.d/config.el:

(map!
 :after comint
 :map comint-mode-map
 :ni "RET" (cmd! (comint-send-input nil t))
 :n "<C-backspace>" #'comint-clear-buffer)

Unfortunately this leads to echoing back the input, which is annoying.

I think I have a workaround. It seems that culprit is nodejs-repl--delete-prompt in comint-output-filter-functions.

(defun dp/nodejs-repl-remove-broken-filter ()
  (remove-hook 'comint-output-filter-functions 'nodejs-repl--delete-prompt t))
(add-hook 'nodejs-repl-mode-hook #'dp/nodejs-repl-remove-broken-filter)

This results in duplicated prompt from time to time. But it's better than freezing.

This seems to be working for me so far!

@abicky
Copy link
Owner

abicky commented Feb 19, 2024

I've released nodejs-repl.el 0.2.5 that has resolved the bug, so I'll close this issue.

@abicky abicky closed this as completed Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants