From e6e57579b02658d171295b9224532309c06a2320 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 27 Sep 2019 16:25:11 +0200 Subject: Emacs: parse ANSI colour codes in compilation (e.g. tsc) buffers --- emacs/.emacs.d/main.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emacs/.emacs.d/main.el b/emacs/.emacs.d/main.el index c7960ca..88d0d55 100644 --- a/emacs/.emacs.d/main.el +++ b/emacs/.emacs.d/main.el @@ -610,6 +610,10 @@ _p_rev _u_pper _=_: upper/lower _r_esolve ;;;; typescript (custom-set-variables '(typescript-indent-level 2)) +(autoload 'ansi-color-apply-on-region "ansi-color") +(defun colorise-compilation-buffer () + (ansi-color-apply-on-region compilation-filter-start (point-max))) +(add-hook 'compilation-filter-hook #'colorise-compilation-buffer) ;;;; shell (general-add-hook 'sh-mode-hook -- cgit 1.4.1