aboutsummaryrefslogtreecommitdiffstats
path: root/oni-eshell.el
diff options
context:
space:
mode:
authorGravatar Tom Willemse2019-09-19 17:33:38 -0700
committerGravatar Tom Willemse2019-09-19 17:33:38 -0700
commitd37d8f969b6609d2d9d7231282abba97ddfab531 (patch)
tree1bc386195bdeb4369ecdbf4823e4ec3a49837fff /oni-eshell.el
parent8724c976fc75f9820ec9d736f2affe33fa071c9a (diff)
downloademacs-config-d37d8f969b6609d2d9d7231282abba97ddfab531.tar.gz
emacs-config-d37d8f969b6609d2d9d7231282abba97ddfab531.zip
Replace ‘ansi-color’ with ‘xterm-color’
According to a tweet from Mickey Petersen[1], ‘xterm-color’ is faster and more accurate. [1]: https://twitter.com/mickeynp/status/1132236557308579840?s=09
Diffstat (limited to 'oni-eshell.el')
-rw-r--r--oni-eshell.el18
1 files changed, 16 insertions, 2 deletions
diff --git a/oni-eshell.el b/oni-eshell.el
index 8530ca9..3126a1d 100644
--- a/oni-eshell.el
+++ b/oni-eshell.el
@@ -4,8 +4,8 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2019.0908.165243
-;; Package-Requires: (eshell-fringe-status esh-autosuggest)
+;; Version: 2019.0919.172336
+;; Package-Requires: (eshell-fringe-status esh-autosuggest xterm-color)
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -27,8 +27,10 @@
;;; Code:
(require 'eshell)
+
(require 'em-prompt)
(require 'esh-autosuggest)
+(require 'xterm-color)
(defun oni-eshell--C-d ()
"Call `delete-char' or close the buffer if it fails."
@@ -48,14 +50,26 @@
"Set `C-d' to quit eshell if used at end of prompt."
(define-key eshell-mode-map (kbd "C-d") #'oni-eshell--C-d))
+(defun oni-eshell--set-xterm-variables ()
+ "Set ‘xterm-color-preserve-properties’ to t."
+ (setq xterm-color-preserve-properties t))
+
(add-hook 'eshell-first-time-mode-hook #'oni-eshell--set-eshell-C-d)
(add-hook 'eshell-load-hook #'oni-eshell--enable-truncating-buffers)
(add-hook 'eshell-mode-hook 'esh-autosuggest-mode)
(add-hook 'eshell-mode-hook 'goto-address-mode)
+(add-hook 'eshell-before-prompt-hook #'oni-eshell--set-xterm-variables)
(when (display-graphic-p)
(add-hook 'eshell-mode-hook 'eshell-fringe-status-mode))
+(add-to-list 'eshell-preoutput-filter-functions 'xterm-color-filter)
+
+(setq eshell-output-filter-functions
+ (remove 'eshell-handle-ansi-color eshell-output-filter-functions))
+
+(setenv "TERM" "xterm-256color")
+
(add-to-list 'display-buffer-alist
'("\\`\\*eshell" display-buffer-in-side-window
(side . bottom)