From: Noam Postavsky <npostavs@gmail.com>
Date: Sun, 18 Jun 2017 19:29:55 +0000 (-0400)
Subject: Reset ansi escape context before printing eshell prompt (Bug#27407)
X-Git-Tag: emacs-26.0.90~521^2~3
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=37cdfec7c73205668498da9b27387f5f3ccfebee;p=emacs.git

Reset ansi escape context before printing eshell prompt (Bug#27407)

* lisp/eshell/em-prompt.el (eshell-emit-prompt): Reset
`ansi-color-context-region'.
---

diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el
index 53a83e6a67b..8c81b43b1fa 100644
--- a/lisp/eshell/em-prompt.el
+++ b/lisp/eshell/em-prompt.el
@@ -117,6 +117,8 @@ arriving, or after."
 
 (defun eshell-emit-prompt ()
   "Emit a prompt if eshell is being used interactively."
+  (when (boundp 'ansi-color-context-region)
+    (setq ansi-color-context-region nil))
   (run-hooks 'eshell-before-prompt-hook)
   (if (not eshell-prompt-function)
       (set-marker eshell-last-output-end (point))