;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
:group 'eshell-mode)
(defcustom eshell-output-filter-functions
- '(eshell-handle-control-codes
+ '(eshell-postoutput-scroll-to-bottom
+ eshell-handle-control-codes
eshell-watch-for-password-prompt)
"*Functions to call before output is displayed.
These functions are only called for output that is displayed
(map-char-table
(function
(lambda (key val)
- (and (>= key 256)
- (/= (char-syntax key) ?w)
+ (and (if (consp key)
+ (and (>= (car key) 128)
+ (/= (char-syntax (car key)) ?w))
+ (and (>= key 256)
+ (/= (char-syntax key) ?w)))
(modify-syntax-entry key "_ "
eshell-mode-syntax-table))))
(standard-syntax-table)))))
nil t)
(set-buffer current))))
-(custom-add-option 'eshell-output-filter-functions
- 'eshell-postoutput-scroll-to-bottom)
-
(defun eshell-beginning-of-input ()
"Return the location of the start of the previous input."
eshell-last-input-start)
(custom-add-option 'eshell-output-filter-functions
'eshell-handle-control-codes)
+(defun eshell-handle-ansi-color ()
+ "Handle ANSI color codes."
+ (require 'ansi-color)
+ (ansi-color-apply-on-region eshell-last-output-start
+ eshell-last-output-end))
+
+(custom-add-option 'eshell-output-filter-functions
+ 'eshell-handle-ansi-color)
+
;;; Code:
;;; arch-tag: ec65bc2b-da14-4547-81d3-a32af3a4dc57