feat(shell): add xterm-color package to colorize compilation buffers

Some commands which output to compilation buffers did not get their
output colorized correctly by default. This ensures that terminal based
escape sequences are correctly handled.
This commit is contained in:
2021-04-07 23:02:03 +01:00
parent 5f4aa98abd
commit 349f007fe9
4 changed files with 48 additions and 1 deletions

View File

@@ -81,6 +81,8 @@
;; Shell
(require 'siren-shell-pop)
(require 'siren-vterm)
(require 'siren-xterm-color)
;; Spelling
(require 'siren-flyspell)

View File

@@ -0,0 +1,22 @@
;;; siren-xterm-color.el --- jimeh's Emacs Siren: xterm-color configuration.
;;; Commentary:
;; Basic configuration for xterm-color.
;;; Code:
(use-package xterm-color
:demand t
:custom
(compilation-environment '("TERM=xterm-256color"))
:init
(defun siren-advice-compilation-filter (f proc string)
(funcall f proc (xterm-color-filter string)))
:config
(advice-add 'compilation-filter :around #'siren-advice-compilation-filter))
(provide 'siren-xterm-color)
;;; siren-xterm-color.el ends here

View File

@@ -188,6 +188,7 @@
("web-beautify" . "e1b45321d8c11b404b12c8e55afe55eaa7c84ee9")
("web-mode" . "8ef47935d638902ba35a557cae5edd6ab6ab1346")
("with-editor" . "ebcbd3b137154e6c5a2b976bacbb89d48ddfa242")
("xterm-color" . "1a4012854c69a5cdaeb5a73d2ad705011892fca3")
("xwidget-plus" . "f67e070a6e1b233e60274deb717274b000923231")
("yaml-imenu.el" . "fa37d9bf8a09af144980a42cc22891b1555a12ae")
("yaml-mode" . "fc5e1c58f94472944c4aa838f00f6adcac6fa992")

View File

@@ -106,6 +106,28 @@
`(fci-rule-color ,(doom-lighten 'base3 0.10))
;; zoom-window
`(zoom-window-mode-line-color ,(doom-blend 'magenta 'bg 0.2)))
`(zoom-window-mode-line-color ,(doom-blend 'magenta 'bg 0.2))
;; xterm-color
`(xterm-color-names
[,(doom-color 'bg) ; black
,(doom-color 'red) ; red
,(doom-color 'green) ; green
,(doom-color 'yellow) ; yellow
,(doom-color 'blue) ; blue
,(doom-color 'magenta) ; magenta
,(doom-color 'cyan) ; cyan
,(doom-color 'fg)] ; white
)
`(xterm-color-names-bright
[,(doom-lighten 'bg 0.25) ; black
,(doom-lighten 'red 0.25) ; red
,(doom-lighten 'green 0.25) ; green
,(doom-lighten 'yellow 0.25) ; yellow
,(doom-lighten 'blue 0.25) ; blue
,(doom-lighten 'magenta 0.25) ; magenta
,(doom-lighten 'cyan 0.25) ; cyan
,(doom-lighten 'fg 0.25)] ; white
))
(provide-theme 'siren-doom-themes-overrides)