help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

npm control characters in compilation output


From: Shakthi Kannan
Subject: npm control characters in compilation output
Date: Mon, 6 Jul 2015 16:13:44 +0530

Hi,

I am currently testing the following code snippet:

=== ~/.emacs ===

(setq inferior-js-mode-hook
      (lambda ()
        ;; We like nice colors
        (ansi-color-for-comint-mode-on)
        ;; Deal with some prompt nonsense
        (add-to-list
         'comint-preoutput-filter-functions
         (lambda (output)
           (replace-regexp-in-string "\033\\[[0-9]+[GK]" "" output)))))

;; for displaying ANSI escape sequences correctly
(eval-after-load 'compile
  '(add-hook 'compilation-filter-hook
        (lambda () (ansi-color-process-output nil))))

(defun npm-test ()
  (interactive)
  (let ((root (locate-dominating-file default-directory "package.json")))
    (unless root
      (error "Here is not npm package"))
    (let ((default-directory root))
      (compile "npm run test"))))

=== END ===

After evaluating the above functions, and running 'npm-test', I still
see control characters in the *Compilation* buffer. What could I be
missing?

The detailed issue is available at:

  https://github.com/defunkt/coffee-mode/issues/306

Appreciate any help in this regard,

Thanks!

SK

-- 
Shakthi Kannan
http://www.shakthimaan.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]