From 581464c7aed6777bf2a78f031e0375345934f4b8 Mon Sep 17 00:00:00 2001 From: Mateus Pinto Rodrigues Date: Fri, 25 Oct 2019 16:39:39 -0300 Subject: [PATCH] Use eshell more fully Emacs now starts on eshell by default. Also it uses xterm-colors package for coloring, instead of default ansi-colors --- elisp/eshell-setup.el | 9 +++++++++ elisp/extras.el | 3 +++ elisp/settings.el | 3 +++ 3 files changed, 15 insertions(+) create mode 100644 elisp/eshell-setup.el diff --git a/elisp/eshell-setup.el b/elisp/eshell-setup.el new file mode 100644 index 0000000..353df18 --- /dev/null +++ b/elisp/eshell-setup.el @@ -0,0 +1,9 @@ +;; colors in eshell +(add-hook 'eshell-mode-hook + (lambda () + (setenv "TERM" "xterm-256color"))) +(add-hook 'eshell-before-prompt-hook (lambda () + (setq xterm-color-preserve-properties t))) +(add-to-list 'eshell-preoutput-filter-functions 'xterm-color-filter) +(setq eshell-output-filter-functions + (remove 'eshell-handle-ansi-color eshell-output-filter-functions)) diff --git a/elisp/extras.el b/elisp/extras.el index 05bb702..770d185 100644 --- a/elisp/extras.el +++ b/elisp/extras.el @@ -38,6 +38,9 @@ (load "~/.emacs.d/elisp/openwith-setup.el")) ;; Programming environment +;; We need colors in eshell +(use-package xterm-color) + ;; git (use-package magit) diff --git a/elisp/settings.el b/elisp/settings.el index bec662c..fbc97b9 100644 --- a/elisp/settings.el +++ b/elisp/settings.el @@ -1,3 +1,6 @@ +;; Initialize emacs in eshell, not splash screen +(setq initial-buffer-choice (eshell)) + ;; Write custom set variables to different file (setq custom-file "~/.emacs.d/elisp/custom.el")