How to make Emacs not highlight trailing whitespace in term?

emacs

Solution

Use this:

(add-hook
 'term-mode-hook
 (lambda() (setq show-trailing-whitespace nil)))

Problem

I'm using this in my .emacs config ``` '(show-trailing-whitespace t) ``` And I'm generally very happy with it. The only problem is that it highlights whitespace when I'm in 'M-x term' buffer and I have no control over that whitespace. How to prevent this?

Original source